/* In class program, turn C to F and back again. Read in the temp in C. */ /* Algorithm Note: need variables for the tmp in both c and f. Node: do not need constants for 9/5 5/9 and 32 prompt for temp in c read in temp in c use the formula to convert from c to f use the formula to convert from f to c print the result */ #include using namespace std; int main() { int tempInC {0}; double tempInF {0}; cout << "Enter a temperature in celsius: "; cin >> tempInC; //tempInF = int(float(9)/float(5)* float(tempInC) + float(32)); tempInF = 9.0/5.0 * static_cast(tempInC) + 32.0; cout << endl; cout << tempInC << " celsius is the same as " << tempInF << " fahrenheit." << endl; return 0; }