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 variablecalled 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.
- Two variables, num_boys and num_girls, hold the number of boys and girls that have registered for an elementary school. The variablebudget holds the number of dollars that have been allocated to the school for the school year. Write code that prints out the per-student budget (dollar spent per student). If a division by zero error takes place, just print out the word “unavailable”.