Question: Exercise #3: SubTotal Write a function named subtotal takes as its arguments the following . a one dimensional array of floating point values an integer

 Exercise #3: SubTotal Write a function named "subtotal" takes as its

Exercise #3: SubTotal Write a function named "subtotal" takes as its arguments the following . a one dimensional array of floating point values an integer that tells the number of cells in the array The function should replace the contents of each cell with the sum of the contents of all the cells in the original array from the left end to the cell in question. Thus, for example, if the array passed to the function looks like this: 5.8 I 2.6 I 9.1 I 3.4 I 7.0 Then when the function returns, the array will have been changed so that it looks like this 5.818.4117.51 20.9127.9 Note that the contents of cell 0 are not changed. The function should not return a value. Write a 2 main program that tests and validates the subtotal function Sample input /output: lease enter the number of values in the array: 5 lease enter the values for your array: 1 2 3 45 15

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!