Program to convert mile-to-kilometers or kilometers-to-mile

Assignment Help Python Programming
Reference no: EM132354912

Question

Write program that prompts the user to select either Miles-to-Kilometers or Kilometers-to-Miles, then asks the user to enter the distance they wish to convert. The conversion formula is:

Miles = Kilometers X 0.6214

Kilometers = Miles / 0.6214

Write two functions that each accept a distance as an argument, one that converts from Miles-to-Kilometers and another that converts from Kilometers-to-Miles

The conversion MUST be done as a separate function that is called by the main program.

There are 15 distances in the data (shown below).

Display the original value and its unit (miles/kilometers) and then the converted value and unit.

Data:

Miles 16

Miles 28

Kilometers 39

Kilometers 44

Miles 11

Kilometers 71

Miles 59

Kilometers 62

Kilometers 34

Miles 19

Miles 25

Kilometers 71

Kilometers 88

Kilometers 90

Miles 110

Turn in your program code and the screen shot of the display. Remember you MUST use functions here.

Reference no: EM132354912

Questions Cloud

Realigning the investments to better match cartman : Or in Cartman's words, she did "cooo." So, instead of realigning the investments to better match Cartman's situation, he just kept things the way they were.
Write a program in python that reads in x whole numbers : Write a program in python that reads in X whole numbers and outputs the sum of all positive numbers, the sum of all negative numbers.
Australian office of financial management : Why is the AOFM (Australian Office of Financial Management) important to Australia's money market and what would happen if they did not exist?
Ratio of price to expected earnings for river cruises : What is the ratio of price to expected earnings for River Cruises before it borrows the $150,000?
Program to convert mile-to-kilometers or kilometers-to-mile : Write program that prompts the user to select either Miles-to-Kilometers or Kilometers-to-Miles, then asks the user to enter the distance they wish to convert.
Compare and contrast the leadership styles : Do research to compare and contrast the leadership styles of the two CEOs. What evidence can you find to support your opinion?
What were flotation costs as a fraction of funds raised : Moonscape has just completed an initial public offering. The firm sold 6 million shares at an offer price of $6 per share.
How do cosmogonies surrounding death and afterlife differ : What similarities do you see between this week's highlighted religious traditions? How do the cosmogonies surrounding death and the afterlife differ?
Capital asset pricing model personal finance problem : Beta coefficients and the capital asset pricing model Personal Finance Problem Katherine

Reviews

Write a Review

Python Programming Questions & Answers

  Write a python program that generates a small web site

ICT112 Assignment - Generated Web Site for Sports Club. Your task is to write Python program that generates small web site for local sports club

  Build a menu-driven application

Build a menu-driven application that will allow a user to maintain their collections. For example, I might have a coin collection, or a record collection, or a collection of all my valuable items.

  Show summary information about an event

Developing will be used by event organizers staff who are promoting social gatherings. e.g. LAN Parties, Board - Create customer details - Name, Email

  Construct a python function using a loop and not the reverse

The mutating variant will return None, and will instead modify the list that it's given. Construct a python function using a loop and not the reverse function

  Write a python program about triangles

Write a PYTHON program about triangles. You need two files, a module file and an executable file with a main method.

  Design a program that will calculate total cost of equipment

In this workshop you will do the planning for a programming problem and implement your solution in Python - Design a program that will calculate the total cost

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Write a python script that counts occurrences of words

Write a python script that counts occurrences of words in a file. The script expects two command-line arguments: the name of an input file and a threshold.

  Create an employee class that keeps data attributes

Create an Employee class that keeps data attributes for the following pieces of information: Employee Name and Employee Number

  What good are movie ids and ratings

Implement a function called topRated(). The function will take a file name as a parameter and return a sorted list - What good are movie IDs and ratings? You want to know the actual title of the movie! Implement a function called getTitles(). The fu..

  Write a program that will accept a string as an argument

In python write a program that will accept a string as an argument and return with the first letter of each sentence capitalized. Must use a for loop.

  Write a program that will ask the user to input the names

Write a program that will ask the user to input the names of cities they would like to visit.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd