Your program should prompt the user for a measurement given in inches. You program should then compute the measurement in yards, feet and inches. Finally, you should provide a check by converting your values back to inches.
Your output should conform to the following example:
Please enter a measurement in inches: 51 51 inches is the same as: Yards: 1 Feet: 1 Inches: 3 Check: 1 Yards 1 Feet and 3 inches is 51 inches.
Get the distance in inches Using div and mod, convert inches to inches and feet Using div and mod, convert feet to feet and yards Compute total inches based on inches feet and yards print the results. Note that for any conversion from smaller to larger: value in smaller / CONVERSION_FACTOR = value in larger value in smaller % CONVERSION_FACTOR = left over in smaller
Measurement in inches: 51 Convert to feet and inches: 51 / 12 = 4 this is feet for now 51 % 12 = 3 this is final inches Convert to yards and feet 4 / 3 = 1 this is yards 4 % 3 = 1 this is feet Compute the total 1 * 3 * 12 + 1 * 12 + 3 = 51 check Print the results.