XJMK
aka boredchimp
- Location
- Neenah, WI
I've got this dumb program with functions and I don't understand whats wrong. Heres one of them, the rest are basically the same, just different variables.
double getGallons();
{
double gallons;
cout << "\nEnter the number of gallons of fuel (between 0.0 and 40.0): ";
cin >> gallons;
while (gallons <0.0 || gallons > 40.0)
{
cout <<"Gallons entered must be between 0.0 and 40.0 \n Try again: ";
cin >> gallons;
}
return gallons;
}
The error says warning: return to 'int' from 'double'
What does that mean? I wrote it the way the teacher described, but she uses pseudo-code sometimes so I don't always understand. TIA
double getGallons();
{
double gallons;
cout << "\nEnter the number of gallons of fuel (between 0.0 and 40.0): ";
cin >> gallons;
while (gallons <0.0 || gallons > 40.0)
{
cout <<"Gallons entered must be between 0.0 and 40.0 \n Try again: ";
cin >> gallons;
}
return gallons;
}
The error says warning: return to 'int' from 'double'
What does that mean? I wrote it the way the teacher described, but she uses pseudo-code sometimes so I don't always understand. TIA