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 18:00
Write a method named addall that could be placed inside the hashintset class. this method accepts another hashintset as a parameter and adds all elements from that set into the current set, if they are not already present. for example, if a set s1 contains [1, 2, 3] and another set s2 contains [1, 7, 3, 9], the call of s1.addall(s2); would change s1 to store [1, 2, 3, 7, 9] in some order. you are allowed to call methods on your set and/or the other set. do not modify the set passed in. this method should run in o(n) time where n is the number of elements in the parameter set passed in.
Answers: 2
question
Computers and Technology, 23.06.2019 00:20
The open systems interconnection (osi) reference model: defines standards for many aspects of computing and communications within a network. is a generic description for how computers use multiple layers of protocol rules to communicate across a network. defines standards for wireless local area network (wlan) communication protocols. details the advantages and disadvantages of various basic network cabling options.
Answers: 1
question
Computers and Technology, 24.06.2019 12:00
Jack is assisting his younger sibling mary with her mathematics assignment, which includes a study of the number system. jack explains to mary that whole numbers are counting numbers that could be used to record the number of fruits in a basket. which data type represents whole numbers? a.integers.b.floating-point numbers. c.strings.d.boolean
Answers: 1
question
Computers and Technology, 24.06.2019 15:00
Who introduced the concept of combining artificial and natural light in the studio
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
question
Mathematics, 11.07.2019 16:30
question
Mathematics, 11.07.2019 16:30
Questions on the website: 13722359