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 ie 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 inches in a foot and 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:
Enter the number of feet:
Enter the number of inches:
The distance you entered is miles, feet, and inches. The equivalent total distance is inches.
Name your source file TotalDistance.cpp
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
