Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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;
Step by Step Solution
★★★★★
3.39 Rating (158 Votes )
There are 3 Steps involved in it
Step: 1
Heres the code for the convertcpp file include iostream include iomanip int main Prompt the user for ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started