Create all the code for a class


Discussion:

Q: Create all the code for a class called ArrayQsn. This class will contain two methods. The first method runningSumMean accepts an array of ints as a parameter, and will return the mean of the values as a double. It also changes the values of the array so that they are running sum values.

For example, the array:
{2, 4, 5, 1, 3}
Would become:
{2, 6, 11, 12, 15}

after the method is called. Do not write more than one loop inside the method. Your method must accept any size array.

If the array is empty (no values), then provide an error message to the screen and return zero.

The second method is the "main" method. Use it to test the runningSumMean method with the array given above. The main method must provide output to the screen that would look like:

Mean = 3
Array: 2, 6, 11, 12, 15

 

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Create all the code for a class
Reference No:- TGS01931930

Now Priced at $20 (50% Discount)

Recommended (98%)

Rated (4.3/5)