Question: Write a program that lets the user enter the total rainfall for each of the 1 2 months into an array of double. The program

Write a program that lets the user enter the total rainfall for each of the 12 months into an array of double. The program should calculate and display the total rainfall for the year, the average monthly rainfall, and the months with the highest and lowest amounts (month numbers).
Input Validation: Do not accept negative numbers for monthly rainfall figures.
USE THE NEXT TEMPLATE (MANDATORY):
//DO NOT MODIFY THIS SECTION
#include
using namespace std;
//prototypes (USE ONLY IF YOU WILL USE FUNCTIONS)
void read( double []);
double total( double []);
void highLow( double [], int &, int & );
int main()
{
//initialization only for tests, commenting the input part
double rainfall[12];//={2.3,5.6,8.2,15.2,4.7,3.7,6.8,3.1,1.1,6.6,2.7,5.5};
int max, min;
//ADD YOUR CODE FROM HER

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!