Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribedC++
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: 2 5.81 2.6 19.1 13.41 7.0 Then when the function returns, the array will have been changed so that it looks like this: 2 5.818.4117.5 1 20.9 1 27.9 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: lease enter the number of values in the array: 5 lease enter the values for your array: 1 2 3 45 6 .1e 15

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_2

Step: 3

blur-text-image_3

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

Understanding Databases Concepts And Practice

Authors: Suzanne W Dietrich

1st Edition

1119827949, 9781119827948

More Books

Students also viewed these Databases questions

Question

See Figure 17.1. Z T = R ? XC ? XL. Question 21 options: True False

Answered: 1 week ago

Question

Advance warning and an explanation for the layoff.

Answered: 1 week ago