#include using namespace std; // file: tfuncts.cpp // Functions that return values // convert between Celsius and Fahrenheit (revised) double FtoC(double tempFahr) { return (tempFahr+40.0)*5.0/9.0 - 40.0; } double CtoF(double tempCels) { return (tempCels+40.0)*9.0/5.0 - 40.0; } int main() { double Cels, Fahr; cout << "Enter a Fahrenheit temperature: "; cin >> Fahr; cout << "That converts to " << FtoC(Fahr) << " Celsius." << endl; cout << "Enter a Celsius temperature: "; cin >> Cels; cout << "That converts to " << CtoF(Cels) << " Fahrenheit." << endl; return 0; } /* Sample output: prompt> tfuncts Enter a Fahrenheit temperature: 100 That converts to 37.7778 Celsius. Enter a Celsius temperature: 100 That converts to 212 Fahrenheit. prompt> tfuncts Enter a Fahrenheit temperature: 68 That converts to 20 Celsius. Enter a Celsius temperature: -40 That converts to -40 Fahrenheit. */