Hello;
Thanks Cshot and everyone else for your help. This is my problem, i have to input 70 degree, relativr humidity between 15 and 35% and 10 MPH. If I input all of this it should return on the screen as true otherwise any other answer reutrns a false. I must be close because I have no errors shown on my display but its still not right.
Code:#include <iostream> #include <string> using namespace std; double Okay_to_spray(double); int main() { double temp, rel_humidity, wind_spd; char spray; cout << "Input the temperature, relative humidity and the wind speed of our plane: \n"; cin >> temp >> rel_humidity >> wind_spd; cout << "The plane's temperature is " << temp << " its relative humidity " << rel_humidity << " and its wind speed is " << wind_spd << ".\n"; cout << spray << "\n"; return 0; } Okay_to_spray() { double temp, rel_humidity, wind_spd, spray; { if (temp == 70) if (rel_humidity >= 15 && rel_humidity <= 35) if (wind_spd == 10) spray = true; else spray = false; } return spray; }![]()



LinkBack URL
About LinkBacks




