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
icon
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.11C
Expert Solution
Step 1

PROGRAM EXPLANATION:

  1. Include the header file.
  2. Define the main function.
  3. Print the menu to the user about the temperature units.
  4. Ask the user to enter the unit and then take temperature as input.
  5. Ask the user to enter the output unit.
  6. Now using the switch-case convert the input temperature into kelvin.
  7. Again using the switch-case convert the corresponding kelvin into an input unit using the formula given in the question.
  8. Print the output temperature.
  9. End of the program.

 

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Random Class and its operations
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,