/****************************************************** * * * * * CSCI 1470; Fall 2005 * * Machine Problem: MP2 * * Purpose: Convert user entered Fahrenheit into * * Celsius * ******************************************************/ #include #include using namespace std; int main(void) { double Fahrenheit, Celsius; cout << "Enter the temperature in Fahrenheit:"; cin >> Fahrenheit; Celsius = (5.0/9.0) * (Fahrenheit - 32.0); cout << endl; cout << "Temperature in Fahrenheit is:" << Fahrenheit << " (unformatted)" << endl; cout << endl; cout << "Temperature in Celsius is:" << Celsius << " (unformatted)" << endl; cout << endl; cout << "Temperature in Fahrenheit is:" << setprecision(2) << fixed << Fahrenheit << " (formatted to two decimal places)" << endl; cout << endl; cout << "Temperature in Celsius is:" << setprecision(2) << fixed << Celsius << " (formatted to two decimal places)" << endl; cout << endl; return 0; }// end of function main