Jun 8 2007

Average rain fall calculator for C++

Posted by Bill Betournay at 9:16 AM
7 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";

}

Comments

Blythe

Blythe wrote on 04/28/09 4:23 PM

Excuse me. Treat all disasters as if they were trivialities but never treat a triviality as if it were a disaster.
I am from Malawi and now teach English, give please true I wrote the following sentence: "Find cheap flights and discount airline tickets."

Thanks :-). Blythe.
Duka

Duka wrote on 06/07/09 1:53 AM

Sorry. Preserving health by too severe a rule is a worrisome malady.
I am from Zimbabwe and learning to write in English, give please true I wrote the following sentence: "We can supply you with following top selling products at a competitive price."

Thank you so much for your future answers :P. Duka.
Sherwood

Sherwood wrote on 06/13/09 6:14 PM

I am really impressed!.
I am from Senegal and learning to write in English, please tell me right I wrote the following sentence: "Dvds gay and lesbian movies page."

Thank you very much :-). Sherwood.
seattle family law lawyer

seattle family law lawyer wrote on 11/28/09 1:03 AM

Well this is very interesting indeed.Would love to read a little more of this. Great post. Thanks for the heads-up…This blog was very informative and knowledgeable
foodsafe panels

foodsafe panels wrote on 11/30/09 9:42 PM

Thanks for such a nice post.

Regards
essay writers

essay writers wrote on 12/21/09 12:36 AM

wow. i hope I have something like that so I could schedule the days I have to really work on my garden. gardening is one of my favourite stress-relievers and predicting rain accurately is a very useful skill and tool to optimize the growth of my herbs and spices

Write your comment



(it will not be displayed)