•void GetOneAmount( /*out*/ float& amount ) // Rainfall
amount
• // for one
month
•// Inputs one month's rainfall amount and, if necessary,
•// repeatedly prints an error message and inputs another
•//
value if the value is negative
•//
Postcondition:
•// amount has been input (repeatedly, if
necessary, along
•// with output of an
error message)
•// && amount
>= 0.0
•{
• do
• {
• cin >> amount;
• if (amount < 0.0)
• cout << "Amount cannot
be negative. Enter again: ";
• } while (amount < 0.0);
•}