// 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 Cel; float Fah; char Sel; float WindChill; float WindSpeed; void printFunctionCF() { //Print Functionn for Celsius to Fahrenheit cout << "For " << Fah << " Degrees f and " << WindSpeed << " mph winds the windchill is: " << WindChill << endl; } void printFunctionFC() { //PrintFunction to Celsius To Fahrenheit cout << "For " << Cel << " Degrees c and " << WindSpeed << " kmh winds the windchill is: " << WindChill << endl; } //Celcius to Fahrenheit int CeltoFar() { cout << "The range is between -62 and 49.5" << endl; cout << "Type your temprature in Celcius: "; cin >> Cel; cout << endl; if (Cel > -62 && Cel < 49.5) { cout << "You entered " << Cel << endl; Fah = 9 / 5 * Cel + 32; cout << "which is " << Fah << " degrees fahrenheit" << endl; } else { cout << "Please Try again" << endl; cout << "Type your temprature in Celcius: "; cin >> Cel; cout << endl; } cout << "Type the windspeed in mph " << endl; cin >> WindSpeed; if (WindSpeed > 0 && WindSpeed < 231) { WindChill = 35.74 + .6215 * Fah - 35.75 * pow(WindSpeed, .16) + .4275 * Fah * pow(WindSpeed, .16); } else { cout << "Please Try again" << endl; cout << "Type the windspeed in mph " << endl; cin >> WindSpeed; } return WindChill; return WindSpeed; return Fah; } int FahtoCel() { //Fahrenheit to Celcius cout << "The range is between -79.6 and 121.1" << endl; cout << "Type your temprature in Fahrenheit: "; cin >> Fah; cout << endl; cout << "You entered " << Fah << endl; Cel = (Fah - 32) * 5 / 9; cout << "which is " << Cel << " degrees celcius" << endl; cout << "Type the windspeed in Km " << endl; cin >> WindSpeed; //windspeed in Kilometers WindChill = 13.12 + .6215 * Cel - 11.37 * pow(WindSpeed, .16) + .3965 * Cel * pow(WindSpeed, .16); return WindChill; return WindSpeed; return Cel; } void menuChoice(char& Cel) { char CH = Sel; //If CH is equal to C or c or F or f call //their respective functions if (CH == 'C' || CH == 'c') { CeltoFar(); printFunctionCF(); } else if (CH == 'F' || CH == 'f') { FahtoCel(); printFunctionFC(); } } int welcomeMessageChoice() { //Welcome Selection cout << "Welcome to the Menu!!" << endl; while (Sel != 'C' && Sel != 'c' && Sel != 'f' && Sel != 'F') { cout << "Cel or Fah" << endl << "Please type C or F: "; cin >> Sel; } //MenuChoice Function Call menuChoice(Sel); return Sel; } //Driver Program int main() { welcomeMessageChoice(); menuChoice(Sel); }