Question: Create four functions; (A) inches to centimeters, (B) centimeters to inches, (C) feet and inches to meters, (D) meters to feet and inches and (E)
Create four functions; (A) inches to centimeters, (B)
centimeters to inches, (C) feet and inches to meters, (D) meters to feet and inches
and (E) exit the program. Your program must accommodate both upper and lower
cases for the choice and produce an error message when an invalid choice is made.
Please Submit:
1. A flowchart of your program. (2 points)
2. Printout of your C++ program with a heading comment, also appropriate spacing
and indentation in the program body. You must use four functions and those
functions must be called from the main program in order to receive any credit.
(6 points)
3. Copy of a screenshot after your program is executed. Test your program with both
upper case and lower case selection. (Ex: a, b, C, D, f, and E) Use the last number of
your student ID + 2 for all input. (2 points)
/*
ELEN 1301-48F Programming Assignment #9.
Name : Your name.
Student ID : Your student ID #.
Due date :
Purpose of the program :
Create a menu driven program with functions that converts inches to
centimeters, centimeters to inches, feet and inches to meters and meters
to feet and inches.
Section 1 : Show a menu.
Section 2 : Perform the conversion according to the users choice.
Section 3 : Repeat section 1 and 2 until an user enters E or e for
exit the program.
*/
// Write your own program.
Output example:
Please select a conversion function to be performed:
A / a : inches to centimeters.
B / b : centimeters to inches.
C / c : feet and inches to meters.
D / d : meters to feet and inches.
E / e : exit the program.
Please enter your command : a
Please enter inches : 11
11 inches = 27.94 cm.
Please select a conversion function to be performed:
A / a : inches to centimeters.
B / b : centimeters to inches.
C / c : feet and inches to meters.
D / d : meters to feet and inches.
E / e : exit the program.
Please enter your command : b
Please enter cm : 11
11 cm = 4.33071 inches.
Please select a conversion function to be performed:
A / a : inches to centimeters.
B / b : centimeters to inches.
C / c : feet and inches to meters.
D / d : meters to feet and inches.
E / e : exit the program.
Please enter your command : C
Please enter feet : 11
Please enter inches : 11
11 feet and 11 inches = 3.6322 meters.
Please select a conversion function to be performed:
A / a : inches to centimeters.
B / b : centimeters to inches.
C / c : feet and inches to meters.
D / d : meters to feet and inches.
E / e : exit the program.
Please enter your command : D
Please enter meters : 11
11 meters = 36 feet and 1.07087 inches.
Please select a conversion function to be performed:
A / a : inches to centimeters.
B / b : centimeters to inches.
C / c : feet and inches to meters.
D / d : meters to feet and inches.
E / e : exit the program.
Please enter your command : f
You entered invalid choice.
Please select a conversion function to be performed:
A / a : inches to centimeters.
B / b : centimeters to inches.
C / c : feet and inches to meters.
D / d : meters to feet and inches.
E / e : exit the program.
Please enter your command : E
Program terminates. Good bye.
Press any key to continue . . .
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
