#include #include // a temperature conversion program int main() { char tempType; float temp, fahren, celsius; cout << "\nEnter the temperature to be converted: "; cin >> temp; cout << "Enter an f if the temperature is in Fahrenheit"; cout << "\n or a c if the temperature is in Celsius: "; cin >> tempType; // set output formats cout << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2); if (tempType == 'f') { celsius = (5.0 / 9.0) * (temp - 32.0); cout << "\nThe equivalent Celsius temperature is " << celsius << endl; } else { fahren = (9.0 / 5.0) * temp + 32.0; cout << "\nThe equivalent Fahrenheit temperature is " << fahren << endl; } return 0; }