Question: Write a C + + program in a file named TotalDistance.cpp that prompts the user to input a distance in miles, feet, and inches. The

Write a C++ program in a file named TotalDistance.cpp that prompts the user to input a distance in miles, feet, and inches. The user should be prompted for each unit separately (i.e., the user inputs the number of miles before being asked for inches, etc.). The program then outputs the user's inputted values, followed by the total distance in inches.
There are 12 inches in a foot and 5,280 feet in a mile. As pointed out in the Style Guide for this Class, our code should not only work but be well designed. To improve the readability of your code, define a constant to hold the number of feet in a mile and use this constant in your calculations. Give this constant a meaningful name. You may also define a constant to hold the number of inches in a foot if you like.
Your program should match the following layout exactly.
Sample Output (user input is in yellow)
--- Total Inches Calculator ---
Enter the number of miles: 0
Enter the number of feet: 1
Enter the number of inches: 1
The distance you entered is 0 miles, 1 feet, and 1 inches. The equivalent total distance is 13 inches.
Name your source file TotalDistance.cpp
Write a C + + program in a file named

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!