Question: Write a program that does the following: 1 . Ask the user to enter a distance in meters. 2 . Store the value entered in

Write a program that does the following:
1. Ask the user to enter a distance in meters.
2. Store the value entered in a variable. (make sure you choose the right name and
data type)
3. Compute the distance in feet and inches. Make sure you use named constants
for 3 and 3.37 literals.
4. Store both feet and inches- in two separate variables. (make sure you choose
the right names and data types)
5. Display the number entered and its conversion in feet and inches.
Good to know:
1 meter =3 feet and 3.37 inches. Let us use this approximation.
12 inches =1 feet.
Note: Often when you work on a project, a domain expert joins the team. The person is
not necessarily a technical person. In our case, someone who knows the conversion
formula told us.
Output examples:
Run1:
Please enter a number of meters to be converted: 5
5 meters is equal to 16 feet and 4.85 inches.
Run2:
Please enter a number of meters to be converted: 10.5
10.5 meters is equal to 33 feet and 11.385 inches

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!