Question: I am taking a C++ programming course and am needing to know this source code. In this assignment, the program will keep track of the

I am taking a C++ programming course and am needing to know this source code.

In this assignment, the program will keep track of the amount of rainfall for a 12-month period. The data must be stored in an array of 12 doubles, each element of the array corresponds to one of the months. The program should make use of a second array of 12 strings, which will have the names of the months. These two arrays will be working in parallel. The array holding the month names will be initialized when the array is created using an initialization list (could also be created as an array of constants). The second array will hold doubles which will be the total rainfall for each month. Using a function, the program will prompt the user for the rainfall for each month (using both arrays) and store the value entered into the array with the rainfall totals; the other is used to display which month the program is asking for the rainfall total.

The output of the program will display the following once the data is all entered:

The total rainfall for the year

The average monthly rainfall

The month with the highest amount of rainfall (must display the month as a string)

The month with the lowest amount of rainfall (must display the month as a string)

The program must have the following functions:

void CollectRainData(double [ ], string [ ], int);

Gets the user input for the rain totals for each month

Parameters array for rainfail totals, array of month names and size of arrays

double CalculateTotalRainfall(double [ ], int);

Calculates the total rainfall from the array parameter.

double CalculateAverage(double, int);

Calculates the Average rainfall

First parameter is the total rainfall, second is number of months

double FindLowest(double [ ], int, int&);

Finds the month with the lowest amount of rainfall, returns this value

Provides the index of the lowest month in the last parameter.

double FindHighest(double [ ], int, int&);

Finds the month with the highest amount of rainfall, returns this value

Provides the index of the highest month in the last parameter.

Pseudocode must be provided in the comment block at the top of the file.

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!