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. 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
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. 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
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
How do you do this? Python. Please comment the explanation for each line of code too.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education