0

Can someone assist me on creating this program? Thank you.


create a program that will allow you to calculate the following:


1) The average gas mileage of a car
2) The range of a given car
3) The cost of a given trip


1) Create a Car.py file that will include the following methods:
a. calcMileage(range,gasUsed)
b. range(range,gasUsed)
c. cost(tripLength,averageMPG,priceOfGas)
2) Create an EnterInfo.py file that will import the Car.py file and prompt the user to enter the information and perform the given task. This can be modeled from the previous assignment.
3) You will have to include try and exception blocks that will allow users to enter floats and handle any bad user input.

4
Contributors
3
Replies
4
Views
10 Years
Discussion Span
Last Post by jrcagle
0

Yeah, the best approach is to post code (or even pseudo-code) and then we can refer to line numbers.

Technically, the objects 'calcMileage', 'range', and 'cost' in the car.py module will be functions rather than methods.

Anyways, show us what you got and we can go from there.

Jeff

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.