Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. """
  2. Transport Type Calculator
  3. Author : Daniel Herrmann
  4. """
  5.  
  6. number_of_people = input("How many people are you taking? : ")
  7. passengers = int(number_of_people)
  8.  
  9. import math
  10.  
  11. shuttle_capacity = 20
  12. van_capacity = 9
  13. car_capacity = 4
  14. bike_capacity = 1
  15.  
  16.  
  17. number_of_shuttles = round(passengers//shuttle_capacity)
  18. remainder = passengers%shuttle_capacity
  19.  
  20. number_of_vans = round(remainder//van_capacity)
  21. remainder = remainder%van_capacity
  22.  
  23. number_of_cars = round(remainder//car_capacity)
  24. remainder = remainder%car_capacity
  25.  
  26. number_of_bikes = round(remainder//bike_capacity)
  27. remainder = remainder%bike_capacity
  28.  
  29. price = number_of_shuttles * 85 + number_of_vans * 45 + number_of_cars * 25 + number_of_bikes * 15
  30.  
  31. print("Number of people: ", passengers)
  32. print()
  33. print("You will need:")
  34. print()
  35. print("===================================")
  36. print("Shuttles: ", number_of_shuttles)
  37. print("Vans: ", number_of_vans)
  38. print("Cars: ", number_of_cars)
  39. print("Motorcycles: ", number_of_bikes)
  40. print()
  41. print("price :$",price)
  42. print("===================================")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement