subject

Two files named numbers1.txt and numbers2.txt both have an unknown number of lines, each line consisting of a single positive integer. write some code that reads a line from one file and then a line from the other file. the two integers are multiplied together and their product is added to a variable called scalar_product which should be initialized to zero. your code should stop when it detects end of file in either file that it is reading. for example, if the sequence of integers in one file was "9 7 5 18 13 2 22 16" and "4 7 8 2" in the other file, your code would compute: 4*9 + 7*7 + 8*5 + 2*18 and thus store 161 into scalar_product.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 03:30
Which group on the home tab allows you to add shapes to a powerpoint slide?
Answers: 1
question
Computers and Technology, 22.06.2019 15:30
Why would a programmer use the logical operator and in an if statement? a: when an action is to be taken that requires both conditions to be falseb: when an action is to be taken that requires both conditions to be truec: when an action is to be taken that requires the first condition to be falsed: when an action is to be taken that requires the second condition to be truei took the test and the answer is b.
Answers: 3
question
Computers and Technology, 22.06.2019 17:00
Acase study allows a more detailed look at the life of a single subject than any other study.
Answers: 3
question
Computers and Technology, 22.06.2019 23:00
In which part of a professional email should you try to be brief, but highly descriptive?
Answers: 1
You know the right answer?
Two files named numbers1.txt and numbers2.txt both have an unknown number of lines, each line consis...
Questions
Questions on the website: 13722361