Create a new file named convert.cpp . In this file, write a program that asks the user
Fantastic news! We've Found the answer you've been seeking!
Question:
Create a new file named convert.cpp In this file, write a program that asks the user for a temperature, then converts that temperature to four semicommon temperature units.
The prompt should be Enter a temperature: followed by a newline and the user will enter a number, followed by a space, followed by a capital letter. The letter specifies a unit. Supported units are as follows, and the results should always print in this order, with exactly two digits after the decimal point:
C for Celsius
F for Fahrenheit
K for Kelvin
R for Rankine
alice@wonderland lab$ convert
Enter a temperature:
F
C
F
K
R
To ensure the correct number of decimal digits, include the iomanip header and add the following line before printing your results C has annoyingly quirky output formatting commands:
std::cout std::fixed std::setprecision;
Related Book For
Posted Date: