/************************************************************************ * Program: F to C converter * * Programmer: Dan Bennett * * Date: Oct 4, 2001 * * * ************************************************************************/ #include #include // gives us setw and setprecision int main () { float tempinf, // the temprature in f. tempinc; // the calculated temprature // used fixed point and show the decimal point in floats cout.setf(ios::fixed, ios::floatfield); cout.setf(ios::showpoint); cout << setprecision(2); cout << "Temprature in F C" << endl; tempinf=0; tempinc = float (5)/9*(tempinf-32); cout << setw(19) << tempinf << setw(11) << tempinc << endl; tempinf= tempinf + 10; tempinc = float (5)/9*(tempinf-32); cout << setw(19) << tempinf << setw(11) << tempinc << endl; tempinf= tempinf + 10; tempinc = float (5)/9*(tempinf-32); cout << setw(19) << tempinf << setw(11) << tempinc << endl; tempinf= tempinf + 10; tempinc = float (5)/9*(tempinf-32); cout << setw(19) << tempinf << setw(11) << tempinc << endl; tempinf= tempinf + 10; tempinc = float (5)/9*(tempinf-32); cout << setw(19) << tempinf << setw(11) << tempinc << endl; tempinf= tempinf + 10; tempinc = float (5)/9*(tempinf-32); cout << setw(19) << tempinf << setw(11) << tempinc << endl; tempinf= tempinf + 10; tempinc = float (5)/9*(tempinf-32); cout << setw(19) << tempinf << setw(11) << tempinc << endl; tempinf= tempinf + 10; tempinc = float (5)/9*(tempinf-32); cout << setw(19) << tempinf << setw(11) << tempinc << endl; tempinf= tempinf + 10; tempinc = float (5)/9*(tempinf-32); cout << setw(19) << tempinf << setw(11) << tempinc << endl; tempinf= tempinf + 10; tempinc = float (5)/9*(tempinf-32); cout << setw(19) << tempinf << setw(11) << tempinc << endl; tempinf= tempinf + 10; tempinc = float (5)/9*(tempinf-32); cout << setw(19) << tempinf << setw(11) << tempinc << endl; return 0; }