Output a prompt using the cerr object that instructs the user to type in a temperature in °F (i.e. Fahrenheit).
Write code that converts the Fahrenheit temperature into Kelvin, Celsius, Rankine, and Reaumur.
The output of your program should be formatted as follows.
72 degree Fahrenheit in:
...Kelvin is 295.37
...Celsius is 22.22
...Rankine is 531.67
...Reaumur is 17.78
-9 degree Fahrenheit in:
...Kelvin is 250.37
...Celsius is -22.78
...Rankine is 450.67
...Reaumur is -18.22
0 degree Fahrenheit in:
...Kelvin is 255.37
...Celsius is -17.78
...Rankine is 459.67
...Reaumur is -14.22
In addition to the turning in the source code for your program, you must also submit a copy of the output generated by your program for the following three user supplied inputs: 72, 0 and -9.
Help
Printing floating-point numbers... insert near top of code...
In addition to the turning in the source code for your program, you must also submit a copy of the output generated by your program for the following three user supplied inputs: 72, 0 and -9.
Help
Printing floating-point numbers... insert near top of code...
int main(int,char**) {
double Fah,Kel,Cel,Ran,Rea ;
cout << " Type a temperature in Fahrenheit and press ENTER: " ;
cin >> Fah;
Kel=(Fah + 459.67) * 5 / 9;
Cel=(Fah-32) * 5/9;
Rea=(Fah-32) * 4/9;
Ran=Fah+459.67;
cout << Fah << " degree Fahrenheit in Kelvin is " << Kel << endl ;
cout << Fah << " degree Fahrenheit in Celsius is "<< Cel<< endl ;
cout << Fah << " degree Fahrenheit in Rankine is "<< Ran <<endl ;
cout << Fah << " degree Fahrenheit in Reaumur is "<< Rea <<endl ;
cout.setf(ios::fixed, ios::floatfield); //??????????
system( "pause" ) ;
return 0 ;
}
what is this for In addition to the turning in the source code for your program, you must also submit a copy of the output generated by your program for the following three user supplied inputs: 72, 0 and -9.
Help
Printing floating-point numbers... insert near top of code...
it says that you must also submit a copy of the output generated by your program for the following three user supplied inputs:72,0 and -9
and it gave that code:
cout.setf(ios::fixed, ios::floatfield);
If you want to know about ios::fixed, it would have been ENTIRELY sufficient to post that line alone.
It will result in floating point numbers being printed with a fixed amount of digits after the decimal point.
Ohh I dont understand anythıng,, this is the assingment shit and it explain what we gonna do.. I typed the turnıng the source code for my program but I couldn't fıgure out what the hell ıs mean that part.. I dont know what am I supposed to do.. It says submit a copy output and it says this code is gonna help you cout.setf(ios::fixed, ios::floatfield);
the all assignment is on top of the page, I thınk ı supposed to write after cout.setf(ios::fixed, ios::floatfield); (code) somethıng... somethıng::..
Yeah, that line will help you in making your output look like it should. Because, as you might have noticed, yours currently does NOT look like the reference output at all.
@Barkin just to make sure you understand what I meant before you turn in your homework, does it look similar to this (i moved the line with cout.setf() above the cout statements) :