Vroom! Vroom!

Create a python3 file (or module) called [login to view URL] that contains the following functions. When you run this file, make sure that the main function is invoked.


• Prompts the user for the tank size (in gallons).

• Prompts the user for the miles per gallon.

• Prompts the user for the cost per gallon.

• Invokes the travel function from [login to view URL] with the tank size, miles per gallon, and cost per

gallon as arguments in that order. The string returned from the travel function is displayed on the console. The travel function is described below.

The [login to view URL] File

You will declare two global variables for total distance traveled and net miles traveled. You need to name these two variables total_distance and net_miles, respectively. The list of the parameters and return values for the functions below assume these global variables exist.

[login to view URL] travel function

The travel function is the primary function for the car simulation. All the other functions are called either directly or indirectly from the travel function. The travel function has three parameters: the tank size, the miles per gallon, and the cost per gallon in that order. It should do the following in orderfind_max_distance: Accepts the tank size and miles per gallon as parameters in that order.

Returns the total possible number of miles that could be traveled rounded to two decimal places.

2. user_loop: Accepts the max distance as its parameter. It does not return anything. See its

description in the next section.

3. find_gallons: Accepts the miles per gallon as parameters. This function tries to compute the

number of gallons used given the total distance the car has traveled and the miles per gallon. This computation is done inside a try-except block. If the calculation causes a division by zero error, then an exception will be thrown by the python interpreter. If an exception is thrown, then “MPG is Zero!” is displayed on the console and zero is returned. If an exception is not thrown, then the number of gallons needed (that is, the result of the division) is returned rounded to two decimal places.

4. find_total_cost: Accepts two parameters, the number of gallons and the cost per gallon in that order. Returns the total cost rounded to two decimal places.

5. report_stats: Accepts two parameters which are total cost and number of gallons used in that order. Construct and returns a string. that has the following features. The report_stats function has no print statements in it when you submit it (you might want to have some print statements in it temporarily while debugging)! The format of the string must be identical to the examples in the example runs later in this handout. The features of the returned string are as follows.

• The total miles traveled.

• The net miles traveled.

• The number of gallons used.

• The total cost.

• A message describing the total cost as shown below:

◦ ``Cha Chiiinng!'' if the total cost is less than 25.00 dollars.

◦ ``Wallet getting nervous!'' if the total cost is equal to or greater than 25.00 dollars but

less than 100.00 dollars

◦ ``Ouch!'' if the total cost is 100.00 dollars or more.

Skills: Python

See more: create website python django, python twisted create ftp server, mysql create user python, vroom vroom new zealand, vroom vroom lyrics, vroom vroom uk, charli xcx vroom vroom, charli xcx vroom vroom songs, vroom vroom meaning, vroom vroom yxng bane, vroom vroom vroom song, create dll file given source code, create questionnaire python, python create csv, create websites python cgi, error 123 testmode account given permissions required request, error message status bar try click javascript, syntax error insert complete block, create website thumbnail google apps python, python error level access

About the Employer:
( 2 reviews ) cullowhee, United States

Project ID: #18018598

Awarded to:


How are you? Like you see in my profile and portfolios, I have rich experience in C/C++, C#, and Python programming. I would like to discuss with you and get more detail requirements. Please give me your details, th More

$25 USD / hour
(9 Reviews)

8 freelancers are bidding on average $20/hour for this job


Hello, I am a python developer having 7 years of experience. I can assure that we are on the same page from the word go as I have worked on projects similar to yours in the past. And, therefore I can easily accomplish More

$22 USD / hour
(5 Reviews)

Hi there, I would like to be considered for your project. I have 3+ years of experience in Python. I'll be glad to help. Best regards, Andrew

$17 USD / hour
(36 Reviews)

Hi we are expert in python we are working for machine learning and data science supervised and unsupervised algorithms e.g Decision trees, SVM, Random forest, KNN, Regression, Clustering, ANN, RNN and specifically in More

$20 USD / hour
(2 Reviews)

Hello! I am very interested in this project. As an economist and VBA & Python developer, I think Ive got the skill set required do complete this task. Hopefully, you will give me a chance to show my work. Thank you More

$20 USD / hour
(1 Review)

I’m a computer science student and have experience in programming in Java and also some in Python enough for the project to be done easily.

$16 USD / hour
(0 Reviews)

I am a Physics graduate with great experience in programming in Python acquired during the career and some research projects. I will do your task in a short time.

$15 USD / hour
(0 Reviews)

My education, experience, and my skills in the area of computer science make me a great candidate for this position.

$22 USD / hour
(0 Reviews)