Law, 26.02.2020 06:31 natalie2sheffield
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.
Answers: 2
Law, 08.07.2019 23:40, rostecorralmart
Which of the follow statements about drinking alcohol and driving is true
Answers: 1
Law, 16.07.2019 23:20, irenecupcake4348
The occupational safety and health administration promulgated a rule requiring warehouse employees to wear hardhats when in the vicinity of an operating forklift. the purpose of the hardhats is to protect employees from danger of falling objects. this rule is
Answers: 2
Two files named numbers1.txt and numbers2.txt both have an unknown number of lines, each line consis...
English, 21.05.2020 00:01
Mathematics, 21.05.2020 00:01
History, 21.05.2020 00:01
History, 21.05.2020 00:01
Mathematics, 21.05.2020 00:01
English, 21.05.2020 00:01