Create a program that repeatedly displays a menu as a prompt, inputs the user’s choice and takes the correct action based on which menu option was selected. If the user made an invalid selection, the program should tell them. The menu options should be: 1 – Convert miles to kilometers 2 – Convert kilometers to miles 3 – Exit the program Actions for each option: 1 – Convert miles to kilometers Ask the user to enter a distance in miles Convert the value entered to kilometers Display the conversion from/to ????????????????????= ?????????? × 1.60934 2 – Convert kilometers to miles Ask the user to enter a distance in kilometers Convert the value entered to miles Display the conversion from/to ??????????= ???????????????????? × 0.621371 3 – Exit the program Display a message that the program is exiting Stop the loop The program should repeat the menu after options 1 and 2. Use OnlineGDB.
Create a
takes the correct action based on which menu option was selected. If the user made an invalid
selection, the program should tell them.
The menu options should be:
1 – Convert miles to kilometers
2 – Convert kilometers to miles
3 – Exit the program
Actions for each option:
1 – Convert miles to kilometers
Ask the user to enter a distance in miles
Convert the value entered to kilometers
Display the conversion from/to
????????????????????= ?????????? × 1.60934
2 – Convert kilometers to miles
Ask the user to enter a distance in kilometers
Convert the value entered to miles
Display the conversion from/to
??????????= ???????????????????? × 0.621371
3 – Exit the program
Display a message that the program is exiting
Stop the loop
The program should repeat the menu after options 1 and 2.
Use OnlineGDB.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images