// BlankConsoleLab.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include using namespace std; using std::cout; using std::cin; using std::endl; float UserInputTemp; float WindSpeed; char CorF; float CelciusToFarenheit(float Celcius2Farenheit) { Celcius2Farenheit = (UserInputTemp * (9 / 5)) + 32; return Celcius2Farenheit; } int main() { cout << "Please enter a temperature in Celcius or Farenheit: "; cin >> UserInputTemp; cout << "If you entered a temperature in Celcius please enter 'C' and if you entered a temperature in Farenheit please enter 'F'. "; cin >> CorF; while (CorF != 'C' && CorF != 'F') { cout << "Please enter either 'C' or 'F': "; cin >> CorF; } if (CorF == 'F') { while (UserInputTemp < -80 || UserInputTemp > 121) { cout << "Please enter a temperature between -80 and 121." << endl; cout << "Please enter a temperature in Farenheit: "; cin >> UserInputTemp; } } else if (CorF == 'C') { while (UserInputTemp < -62 || UserInputTemp > 49.5) { cout << "Please enter a temperature between -62 and 49.5." << endl; cout << "Please enter a temperature in Celcius: "; cin >> UserInputTemp; } cout << "The temperature you entered is " << CelciusToFarenheit(UserInputTemp) << " degrees in Farenheit." << endl; } cout << "Please enter a wind speed in Miles Per Hour: "; cin >> WindSpeed; while (WindSpeed < 0 || WindSpeed > 231) { cout << "Please enter a wind speed between 0 and 231 Miles Per Hour" << endl; cout << "Please enter a wind speed in Miles Per Hour: "; cin >> WindSpeed; } //cout << "The temperature you entered is " << CelciusToFarenheit(UserInputTemp) << " degrees in Farenheit." << endl; return 0; }