Advertisement
Guest User

Untitled

a guest
Sep 11th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #This program helps a person decide whether to buy a hybrid car.
  2. userInput = input("The cost of a new car ")
  3. car_cost = float(userInput)
  4. userInput = input(" The estimated miles driven per year ")
  5. miles_per_year = float(userInput)
  6. userInput = input("The estimated gas prices ")
  7. gas_price = float(userInput)
  8. userInput = print("The effieiency in miles per gallon ")
  9. efficiency = float(userInput)
  10. userInput = print("The estimated resale value after 5 years ")
  11. resale = float(userInput)
  12. NUM_YEARS = 5
  13. totalCost = car_cost - resale + ((NUM_YEARS * miles_per_year)/(efficiency * gas_price))
  14. print(" The total cost is", totalCost)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement