Write a program that prompts the user

Assignment Help Python Programming
Reference no: EM132260013

Write a 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

Verified Expert

This assignment if of python programming.In this program we create two function to convert miles to kilometers and kilometers to miles.The main function displays a menu for the user to make the choice and program then ask the user to input the required distance and displays the distance in miles or kilometers as per choice.

Reference no: EM132260013

Questions Cloud

Assess an organization strategic plan for training : The course's final project is the development of a complete training program, using the ADDIE model. Your final project submission should include work you have.
What path did this person take to entrepreneurship : What path did this person take to entrepreneurship? What personal sacrifices or investments did this person make in the journey?
Business strategy-strategy implementation : Though flexibility and adaptability are often required in today’s business world, organizations still require a roadmap that encompasses the parameters against
What are the components of being a manager : What are the components of being a Manager? Thinking about yourself, determine if you are a Manager how you will use power.
Write a program that prompts the user : Write two functions that each accept a distance as an argument, one that converts from Miles-to-Kilometers and another that converts from Kilometers
Responsible for setting air quality standards : Under the Clean Air Act, only state governments are responsible for setting air quality standards
Determine the root cause of the problem by using the 5 why : Suppose you are Sales Manager for Almarai-L'usine division. It has product such as Cup Cakes, muffins, croissant, Bread, Burger, Buns and Sandwich Rolls.
Explain how given concepts are represented in the scenario : Explain how these concepts are represented in this scenario. Describe any cultural norms and values you see represented in this scenario.
The issues you see that might delay or cause bottlenecks : Describe the route and the issues you see that might delay or cause bottlenecks. Failure will result in the company suffering large losses on a contract.

Reviews

Write a Review

Python Programming Questions & Answers

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  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.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

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