The goal of this lab is to create a calculator to convert a temperature between different units. Print a menu of temperature units available as either an input or output to the calculator Ask the user for the units of the input temperature Use the unit_input variable to grab a character Ask the user for the desired units of the output temperature Use the unit_output variable to grab a character Ask the user for the input temperature (use prior unit_input character in the print statement) Create a switch/case statement that calculates the Kelvin equivalent of the input temperature Use the Kelvin Variable to hold the result Have a case for each input temperature (remember to use 'single quotes' for characters) Create a switch/case statement that calculates the desired equivalent output temperature Convert from Kelvin to desired units Store the result in the output variable Have a case for each output temperature (remember to use 'single quotes' for characters) -Display the result Some useful formulas: [K] = [C] + 273.15 [K] = 5/9 * ( [F] + 459.67 ) [K] = 5/9 * [R] An example of the program is displayed below: **********TEMPERATURE CONVERSION CALCULATOR********** *******Temperature Units****** C) Celsius K) Kelvin F) Fahrenheit R) Rankine Input Temperature Unit(C, K, F, or R)>F Output Temperature Unit(C, K, F, or R)>C Enter Temperature (deg F)>70 RESULT: 70.00F is equal to 21.11C
The goal of this lab is to create a calculator to convert a temperature between different units. Print a menu of temperature units available as either an input or output to the calculator Ask the user for the units of the input temperature Use the unit_input variable to grab a character Ask the user for the desired units of the output temperature Use the unit_output variable to grab a character Ask the user for the input temperature (use prior unit_input character in the print statement) Create a switch/case statement that calculates the Kelvin equivalent of the input temperature Use the Kelvin Variable to hold the result Have a case for each input temperature (remember to use 'single quotes' for characters) Create a switch/case statement that calculates the desired equivalent output temperature Convert from Kelvin to desired units Store the result in the output variable Have a case for each output temperature (remember to use 'single quotes' for characters) -Display the result Some useful formulas: [K] = [C] + 273.15 [K] = 5/9 * ( [F] + 459.67 ) [K] = 5/9 * [R] An example of the program is displayed below: **********TEMPERATURE CONVERSION CALCULATOR********** *******Temperature Units****** C) Celsius K) Kelvin F) Fahrenheit R) Rankine Input Temperature Unit(C, K, F, or R)>F Output Temperature Unit(C, K, F, or R)>C Enter Temperature (deg F)>70 RESULT: 70.00F is equal to 21.11C
Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter9: Sequential Access Files And Menus
Section: Chapter Questions
Problem 11E
Related questions
Question
c code please 3.30 Lab: Temperature Converter with a Menu
The goal of this lab is to create a calculator to convert a temperature between different units.
- Print a menu of temperature units available as either an input or output to the calculator
- Ask the user for the units of the input temperature
- Use the unit_input variable to grab a character
- Ask the user for the desired units of the output temperature
- Use the unit_output variable to grab a character
- Ask the user for the input temperature (use prior unit_input character in the print statement)
- Create a switch/case statement that calculates the Kelvin equivalent of the input temperature
- Use the Kelvin Variable to hold the result
- Have a case for each input temperature (remember to use 'single quotes' for characters)
- Create a switch/case statement that calculates the desired equivalent output temperature
- Convert from Kelvin to desired units
- Store the result in the output variable
- Have a case for each output temperature (remember to use 'single quotes' for characters) -Display the result
Some useful formulas:
- [K] = [C] + 273.15
- [K] = 5/9 * ( [F] + 459.67 )
- [K] = 5/9 * [R]
An example of the program is displayed below:
**********TEMPERATURE CONVERSION CALCULATOR********** *******Temperature Units****** C) Celsius K) Kelvin F) Fahrenheit R) Rankine Input Temperature Unit(C, K, F, or R)>F Output Temperature Unit(C, K, F, or R)>C Enter Temperature (deg F)>70 RESULT: 70.00F is equal to 21.11CExpert Solution
Step 1
PROGRAM EXPLANATION:
- Include the header file.
- Define the main function.
- Print the menu to the user about the temperature units.
- Ask the user to enter the unit and then take temperature as input.
- Ask the user to enter the output unit.
- Now using the switch-case convert the input temperature into kelvin.
- Again using the switch-case convert the corresponding kelvin into an input unit using the formula given in the question.
- Print the output temperature.
- End of the program.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,