You are to write a program that converts a Fahrenheit temperature to Celsius. The design of this program is important as I want you to break your program into separate functions and have the main() function call these to do the work. We will discuss in class in more detail.
Function prototypes should be similar to the ones shown below:
do
{
displaytable(fahrenheit, celsius);
cin >> fahrenheit;
}
while (fahrenheit > -55 || fahrenheit < 125);
{
cout << "Please enter Fahrenheit Temperature. Number should be between -55 to 125 ";
cin >> fahrenheit;
}
return 0;
}
double getfahrenheit()
{
double fahrenheit;
cout << "Please enter Fahrenheit Temperature. Number should be between -55 to 125 ";
cin >> fahrenheit;
return fahrenheit;
}
void displaytable(double Fahrenheit, double celsius)
{
cout << "Please enter Fahrenheit Temperature. Number should be between -55 to 125 "<<endl;
cout << "Fahrenheit\t Celsius"<<endl;
cout << "-----------------------\n";
cout << Fahrenheit << " \t" << celsius<< endl;
}
double converttocelsius(double fahrenheit)
{
double celsius;