Question: Help C++ question Program Weight Converter. functions: prototypes, definitions, calls, and client program Design and implement a modular, menu-driven program that converts kilograms to pounds
Program Weight Converter. functions: prototypes, definitions, calls, and client program
Design and implement a modular, menu-driven program that converts kilograms to pounds and pounds to kilograms. 1 kilogram = 2.2 pounds. The program should display a menu, then get and validate user input for the menu choice. Then if the choice is other than quit, the program should get user input for the weight to be converted, call the appropriate function to do the desired conversion, and print the returned result. The code should continue iterating to allow additional conversions to be done until the user enters the menu choice to quit.
Write the following four functions and use them in your program:
displayMenu a void function with no parameters. This function displays three menu choices: convert kilograms to pounds, convert pounds to kilograms, and quit
getChoice a value-returning function. Gets user input for menu choice, validates, and returns the user's menu choice. Hint: see Chapter 6 Practice It (Lab 6.4)
kilosToPounds a value-returning function with one parameter. Accepts a weight in kilograms, calculates, and returns the weight converted to pounds
poundsToKilos a value-returning function with one parameter. Accepts a weight in pounds, calculates, and returns the weight converted to kilograms
Other requirements:
Write function prototypes for the four functions and place them before main
Write function definitions for the four functions and place them after main
Do not put any input or output statements in the conversion functions
Weight Converter Sample output :
Welcome to the Weight Converter!
1. Convert kilograms to pounds
2. Convert pounds to kilograms
3. Quit
2
Weight to be converted: 12.5
12.5 pounds = 5.68182 kilograms.
1. Convert kilograms to pounds
2. Convert pounds to kilograms
3. Quit
3
bye!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
