#include using namespace std; using std::cout; using std::cin; using std::endl; using std::string; char y; char n; int fahrenheit(int t); //changes celsius to farenheit int fahrenheit(int t) { int f{}; //f = (t * (9 / 5)) + 32; f = (9 / 5) * t + 32; return f; } int main() { float t{}; int f{}; float w{}; float wc{}; char choice{}; //collects a temp cout << "Enter a temperature between -80 and 121: "; cin >> t; //makes sure temp is between -80 and 121 if (t < -80 || t > 121) { cout << "Input invalid, please enter a number between -80 and 121" << endl; cin.ignore(99, '\n'); return t; } cout << "type y or n" << " is the tempterature in fahrenheit?"<> t; if (char choice = 'n') { f = fahrenheit(t); } else if (char choice = 'y') { cin >> f; } //collects windspeed cout << "Enter a wind speed between 0 and 231: "; cin >> w; //windspeed between 0-231 if (w < 0 || w > 231) { cout << "Input invalid, please enter a number between 0 and 231" << endl; cin.ignore(99, '\n'); return w; } //f = temp w = wind wc = (35.74 + 0.6215 * f - 35.75 * pow(w, 0.16) + .4275 * f * pow(w, 0.16)); //displays wind, temp, and windchill cout << w << " wind" << endl; cout << f << " temp" << endl; cout << wc << " wind chill" << endl; }