Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

USING C++ Exercise #2: SubTotal Write a function named subtotal takes (1) an array of floating point values; (2) an integer that tells the number

image text in transcribed

USING C++

Exercise #2: SubTotal Write a function named "subtotal" takes (1) an array of floating point values; (2) an integer that tells the number of cells in the array as its arguments the following 2/4 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.82.61 9.13.47.0 Then when the function returns, the array will have been changed so that it looks like this 5.88.4 17.5 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 of cell 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: Please enter the number of values in the array: Please enter the values for your array: 10 13.2 Process returned 0 (0xe) execution time 19.703 s Press any key to continue

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Time Series Databases New Ways To Store And Access Data

Authors: Ted Dunning, Ellen Friedman

1st Edition

1491914726, 978-1491914724

More Books

Students also viewed these Databases questions

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago