Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C++, will rate! Convert Temperature: Write a program that converts a Celsius temperature to Fahrenheit or a Fahrenheit temperature to Celsius. The program should

In C++, will rate!

image text in transcribed

Convert Temperature: Write a program that converts a Celsius temperature to Fahrenheit or a Fahrenheit temperature to Celsius. The program should be menu driven with three options. The program should loop until the user enters option 3: Temperature Converter 1. Convert Fahrenheit to Celsius 2. Convert Celsius to Fahrenheit 3. Quit After the user enter a menu option, it should ask for a temperature. Create two void functions, one to display the menu and one for calculating the new temperature. This function should take in two parameters, temperature and convert mode (C or F). If the convert mode is C, the temperature should be converted to Celsius and if the mode is F, the temperature should be converted to Fahrenheit. Display the new temperature before returning to the main function then display the menu again. If the user enters 3, the program should display the message, "Program ending" and terminate the program. Validate the menu choice to only accept 1, 2, or 3. If an invalid number is entered, give an error message to the user (see solution for exact message to display) and display the menu again

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions