Question: Write a Python program that gets the three following values from the user ( you may assume all inputs are valid and non - negative

Write a Python program that gets the three following values from the user (you may assume all inputs are valid and non-negative):
The distance to a destination (in miles)
The amount of fuel in the user's car (in gallons)
The # of miles the user's car can travel per gallon of gas (i.e., Miles Per Gallon)
Calculate the percentage of fuel currently in the car that's needed to reach the destination. For example, if 10 gallons are required and there are 10 gallons in the car, the percentage is 1.0(100%) or if 5 gallons are required and there are 10 gallons in the car the percentage of fuel consumed is 0.5(50%).
Finally, output whether or not the user needs to refuel during a round trip, using the below table as a guide:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!