Jun
8
2007
Average rain fall calculator for C++
Posted by Bill Betournay at 9:16 AM
0 comments - Categories:
C++
A snippet in C++ to calculate Average Rain. Class Assign #1
If you're planning to use this for one of your assignments you need to be warned that your teach will likely recognize this.
Coldfusion Version is here http://www.datapacks.com/MB/post.cfm/average-rainfall-calculator
// Program Name: average rain fall// Date Created: Oct 13.2005
// Date Last Compiled: Oct 13.2005
// Purpose: calculate average rain fall for 3 months
void main (void)
{
float
m1 = 0.00,
m2 = 0.00,
m3 = 0.00,
avg = 0.00;
cout << "\n\t Enter the rain fall for the month of June(mm) : ";
cin >> m1;
cout << "\n\t Enter the rain fall for the month of July(mm) : ";
cin >> m2;
cout << "\n\t Enter the rain fall for the month of Aug(mm) : ";
cin >> m3;
avg = (m1 + m2 + m3)/3;
system("cls");
cout.precision(2);
cout.setf(ios :: fixed | ios :: showpoint);
cout << "\n\t Average rain fall for June, July and Aug is " << (avg) << " millimeters" << "\n\t";
}