Write a program (IN C++) that will present the user with a main menu of options which the user can choose from to perform simple unit conversions. Once the user has chosen an option from the menu, the program should provide a brief explanation of the conversion to be performed and allow the user to enter a quantity to be converted. The program should then display the converted result. After performing the conversion, the program should return the user back to the main menu. When the program first runs, it should print out a brief description of what the program does. After the description, the program should print out a “main menu” similar to the following: Here is the menu. Enter your choice (or q to quit): a) Convert kilometers to miles b) Convert miles to kilometers c) Convert meters to feet d) Convert feet to meters e) Convert centimeters to inches f) Convert inches to centimeters When the user picks an option from the menu, the program should take in input from the user and perform the conversion, along with proper prompts. For example, if the user selects option “a”, the program should ask the user to input the number of kilometers to be converted, and the program should print out the converted number. After the conversion is performed, the program should return to the main menu. When the user enters “q” at the main menu, the program should quit immediately.   Specific Implementation Requirements: 1.The menu should be implemented as a switch statement. 2. Each conversion should be done by a function that takes a single argument of a floating point number. Each function should return a floating point number. There are 6 conversions to be done, so there should be 6 of these functions. 3. All input from the keyboard and output to the screen should be done in main – nowhere else. 4. All functions should have appropriate comments explaining what data the function takes in, what data the function returns, and what the function does (this includes main). 5. Conversion from kilometers to miles should be done by multiplying the number of kilometers by 0.621371. 6. Conversion from miles to kilometers should be done by multiplying the number of miles by 1.60934. 7. Conversion from meters to feet should be done by multiplying the number of meters by 3.28084. 8. Conversion from feet to meters should be done by multiplying the number of feet by 0.3048. 9. Conversion from centimeters to inches should be done by multiplying the number of centimeters by 0.393701. 10. Conversion from inches to centimeters should be done by multiplying the number of inches by 2.54.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%
Write a program (IN C++) that will present the user with a main menu of options which the user can choose from to perform simple unit conversions. Once the user has chosen an option from the menu, the program should
provide a brief explanation of the conversion to be performed and allow the user to enter a quantity to be
converted. The program should then display the converted result.
After performing the conversion, the program should return the user back to the main menu. When the program first runs, it should print out a brief description of what the program does.
After the description, the program should print out a “main menu” similar to the following:
Here is the menu. Enter your choice (or q to quit):
a) Convert kilometers to miles
b) Convert miles to kilometers
c) Convert meters to feet
d) Convert feet to meters
e) Convert centimeters to inches
f) Convert inches to centimeters
When the user picks an option from the menu, the program should take in input from the user and perform the conversion, along with proper prompts. For example, if the user selects option “a”, the
program should ask the user to input the number of kilometers to be converted, and the program should
print out the converted number. After the conversion is performed, the program should return to the
main menu.
When the user enters “q” at the main menu, the program should quit immediately.
 
Specific Implementation Requirements:
1.The menu should be implemented as a switch statement.
2. Each conversion should be done by a function that takes a single argument of a floating point number. Each function should return a floating point number. There are 6 conversions to be done, so there should be 6 of these functions.
3. All input from the keyboard and output to the screen should be done in main – nowhere else.
4. All functions should have appropriate comments explaining what data the function takes in, what data the function returns, and what the function does (this includes main).
5. Conversion from kilometers to miles should be done by multiplying the number of kilometers by 0.621371.
6. Conversion from miles to kilometers should be done by multiplying the number of miles by 1.60934.
7. Conversion from meters to feet should be done by multiplying the number of meters by 3.28084.
8. Conversion from feet to meters should be done by multiplying the number of feet by 0.3048.
9. Conversion from centimeters to inches should be done by multiplying the number of centimeters by 0.393701.
10. Conversion from inches to centimeters should be done by multiplying the number of inches by 2.54.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 7 steps with 7 images

Blurred answer
Knowledge Booster
ADT and Class
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education