Question: ANSWER ALL (2) QUESTIONS. Question 1 (15 marks) Write a complete C program to convert miles to kilometers and pounds to kilograms. Your program should

ANSWER ALL (2) QUESTIONS. Question 1 (15 marks) Write a complete C program to convert miles to kilometers and pounds to kilograms. Your program should satisfy the following requirements a. Provide the user with a menu that offers the following options, convert miles to kilometers, convert pounds to kilograms and Exit. b. Prompt the user to enter the number to be converted, c. Beside function main(), the program needs to define four (4) user-defined functions as described in Table 5. The sample output of this program is shown in Figure 6. The printed output must be formatted in 3 decimal numbers. Table 5 Function Description convMiletoKm) This function convert miles to kilometres 1 mile = 1.61 kilometer This function should accept mile as argument and returns kilometer value. convPoundtoKg0 This function convert pound to kilogram 1 pound = 0.454 kilogram This function should accept pound as argument and returns kilogram value. getData() This function prompts the user to enter the number to be converted, This function has no argument and returns the number value, This function displays the menu and has no argument and returns no value. menuDisplay Please input 1 Convert miles to kilometers 2 Convert pounds to kilograms 3 Exit Please input the number to be converted 120 120 miles - 193.200 kilometers Please input 1 Convert miles to kilometers 2 Convert pounds to kilograms 3 Exit Please input the number to be converted 235 235 pound - 106.690 kilograms Please input 1 Convert miles to kilometers 2 Convert pounds to kilograms 3 Exit Thank you! Figure 6: Sample output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
