//Jacklyn Isordia CSC5 Chapter 3, P. 143, #04
//
/**************************************************************
*
* Calculate Average Rainfall
* ____________________________________________________________
* This program calculates the average rainfall for three months. The user
* enters the name of each month and the rainfall amount (in inches) for each
* month. The program then computes the average rainfall
* Computation is based on the formula:
* Average Rainfall = (Rain1 + Rain2 + Rain3) / 3
* ____________________________________________________________
* INPUT
* month1 : name of first month
* month2 : name of second month
* month3 : name of third month
* rain1 : rainfall for month1 (in inches)
* rain2 : rainfall for month2 (in inches)
* rain3 : rainfall for month3 (in inches)
*
* OUTPUT
* averageRain : average rainfall for the three months
*
**************************************************************/
#include <iostream>
#include <string>
using namespace std;
int main ()
{
string month1;
string month2;
string month3;
float rain1;
float rain2;
float rain3;
float averageRain;
//
// Input Values
//
cout << "Enter the first month: " << endl;
cin >> month1;
cout << "Enter the second month: " << endl;
cin >> month2;
cout << "Enter the third month: " << endl;
cin >> month3;
cout << "Enter rainfall (in inches) for " << month1 << ": " << endl;
cin >> rain1;
cout << "Enter rainfall (in inches) for " << month2 << ": " << endl;
cin >> rain2;
cout << "Enter rainfall (in inches) for " << month3 << ": " << endl;
cin >> rain3;
//
// Compute Average Rainfall
//
averageRain = (rain1 + rain2 + rain3) / 3;
//
// Output Result
//
cout << "The average rainfall for "
<< month1 << ", " << month2 << ", and " << month3
<< " is " << averageRain << " inches." << endl;
return 0;
}