Answered step by step
Verified Expert Solution
Question
1 Approved Answer
4) (10 pts) Write a script that will prompt the user for a distance in miles, and then a 'K' for kilometers or 'M'
4) (10 pts) Write a script that will prompt the user for a distance in miles, and then a 'K' for kilometers or 'M' for meters. The script will convert and print the corresponding distance in the corresponding unit specified by the user. The conversions are: Kilometers = Miles*1.6 Meters Miles*1600 Use two decimal points when displaying numbers. For example, the execution of the script might look like this: >>Enter the distance in miles: 26 >>Do you want to convert to Kilometer (K) or Meter (M)? M >>The distance of 26.00 miles is equal to 41600.00 meters.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Heres a script that prompts the user for a distance in miles and the desired unit of conversion kilo...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started