SHARE
TWEET

Untitled

a guest Sep 11th, 2019 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top