Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #This program helps a person decide whether to buy a hybrid car.
- userInput = input("The cost of a new car ")
- car_cost = float(userInput)
- userInput = input(" The estimated miles driven per year ")
- miles_per_year = float(userInput)
- userInput = input("The estimated gas prices ")
- gas_price = float(userInput)
- userInput = print("The effieiency in miles per gallon ")
- efficiency = float(userInput)
- userInput = print("The estimated resale value after 5 years ")
- resale = float(userInput)
- NUM_YEARS = 5
- totalCost = car_cost - resale + ((NUM_YEARS * miles_per_year)/(efficiency * gas_price))
- print(" The total cost is", totalCost)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement