Question: C++ Exercise #2: SubTotal Write a function named subtotal takes as its arguments the following: (1) an array of floating point values; (2) an integer
C++ Exercise #2: SubTotal Write a function named "subtotal" takes as its arguments the following: (1) an array of floating point values; (2) an integer that tells the number of cells in the array. 2/4 The function should replace the contents of each cell with the sum of the contents of all the cells in the function looks like this: 5.8 2.61 9.1 1 3.417.0 the original array from the left end to the cell in question. Thus, for example, if the array passed teo Then when the fiunction returns, the array will have been changed so that it looks like this: 5.8 1 8.4 1 17.51 20.9 27.9 Because 5.8 + 2.6 = 8.4 and 5.8 + 2.6 + 9.1 = 17.5 and so on. Note that the contents ofcell 0 are not changed. The function should not return a value. Write a main program that tests and validates the subtotal function. Sample input/output: lease enter the number of values in the array: Please enter the valies for your array 2. .2 10 13.2 rocess returned e (x execution time 19.703 s ress any key to continue
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
