Write a program to convert a US Customary System length in miles, yards, feet and inches to a Metric System length in kilometers meters, and centimeters. A sample run is seen in grey from the figure. After the numbers of miles, yards, feet and inchers are entered, the length should be converted entirely to inches and then divided by 39.37 to obtain the value in meters. The int function should be used to break the total meters into a whole number of kilometers and meters. The number centimeters should be displayed to one decimal place. The needed formulas are as follows:
Total_inches = 63360*miles + 36*yards + 12*feet + inches
Total_meters = total_inches/39.37
kilometers = int(total_meters/1000)
You will need to write out the rest of the numbers in meters left over after converting to kilometer. For example if the total meters calculated is 6035.358765. Your out should be 6 kilometers, 35 meters and 35.9 centimeters. Make sure to have functions for each calculations and for the user defined inputs. Check to make sure that user inputs are a number and not a character.
Sample output:
Enter number of miles: 5
Enter number of yards: 20
Enter number of feet: 2
Enter number of inches: 4
Metric length:
8 kilometers
65 meters
73.5 centimeters