Hey guys-
I wrote this code and am completely lost :( I can not use any arrays or vectors. Any help is greatly appreciated!!! My code is below, I just can't seem to figure out what I am doing wrong. Thank you!
It is supposed to look like this when run:
*****************************************************************
Welcome to the Rain Fall Program
You will enter the rainfall for the surrounding 3 counties and the month
it occurred (the Rain Fall Must be > 0).
Program Developed by: Koa
*****************************************************************
//validate input (I had to make this function return a value, because I didn't know how to save the variable otherwise if the person first put 0')
void getRainFall(string county1, county2, county3, string month1, month2 month3, double &rainFall);
double county 1 = St Lucie County;
double county 2 = Martin County;
double county 3 = Palm Beach County;
void findGreatestRainFall (string month1, string month2, string month3, double rainfall_1, double rainfall_2 , double rainfall_3);
void findLeastRainFall (string month1, string month2, string month3,
double rainfall_1, double rainfall_2 , double rainfall_3);
void welcome();
double rainSum(double rain1, double rain2, double rain3);
{
string month1 = month1;
double inches = rainfall;
if (inches <= 0) {
while(inches <= 0) {
cout << "Invalid inches input.... inches must be greater than 0 \n";
cout << "Please enter the rainfall in inches:" ;
cin >> inches;
cout << "\n";
}
std::cout << "********* Your least amount of rainfall inches is: " << inches3 << " *********";
cout << "\n";
} else if(inches == inches2 && inches == inches3) {
printf("We have a 3 way TIE!! No greatest or least for this....");
cout << "\n";
}
else if(inches == inches2) {
std::cout << "We have a TIE " << month1 << " and " << month2 << " are equal...";
cout << "\n";
std::cout << "********* Your tied number of rainfall inches is: " << inches << " *********";
cout << "\n";
} else if(inches == inches3) {
std::cout << "We have a TIE " << month << " and " << month3 << " are equal...";
cout << "\n";
std::cout << "********* Your tied number of rainfall inches is: " << inches << " *********";
cout << "\n";
} else if(inches2 == inches3) {
std::cout << "We have a TIE " << month2 << " and " << month3 << " are equal....";
cout << "\n";
std::cout << "********* Your tied number of rainfall inches is: " << inches2 << " *********";
cout << "\n";
}
}
void welcome()
{
for(int i = 0; i < 45; i++) {
cout << "*";
}
cout << "\n";
cout << "Welcome to the Rainfall Program \n";
cout << "You will Enter the rainfall for the surrounding 3 counties and \n";
cout << "the month it occurred (the Rain Fall Must be > 0). \n";
cout << "\n";
cout << "Program Developed by: Koa \n";
{
cout << "*********************************************\n";
}
cout << "Please enter a real number for the rainfall in inches (the number must be > 0). \n";
for(int i = 0; i < 45; i++)
cout << "\n";
}
double rainSum(double rain1, double rain2, double rain3);
{
double sum = 0;
double inches = ti1;
double inches2 = ti2;
double inches3 = ti3;
return (inches + inches2 + inches3) / 3.0;
return sum;
}
int main()
{
//A. Declare and Initialize Variables to Store month’s(each county) Names(leasat), inches(greatest), and Average(sum)
string month = "Please enter the county's rainfall month: ";
string inches = "Please enter the month's rainfall in inches: ";