Oct-30-2019, 11:47 PM
Hello,
So the purpose of this script is to take an input of passengers and calculate the cheapest cost of required buses. BigBus takes 48 passengers and small bus takes 10. E.g. 50 people would be 1 bigBus ($200 )and 1 smallBus ($95) = $295 and 20 passengers would just be 2 small and its associated cost.
Current script:
So the purpose of this script is to take an input of passengers and calculate the cheapest cost of required buses. BigBus takes 48 passengers and small bus takes 10. E.g. 50 people would be 1 bigBus ($200 )and 1 smallBus ($95) = $295 and 20 passengers would just be 2 small and its associated cost.
Current script:
passengers = int(input("How many passengers? ")) bigBus = 0 smallBus = 0 remaining = passengers % 48 while passengers > 0: if passengers // 48 + int(remaining > 20): bigBus += 1 else: (remaining + 9) // 10 * int(remaining <= 20) smallBus += 1 cost = (bigBus * 200) + (smallBus * 95) print("Hire", bigBus, "big buses and", smallBus, "small buses.") print("Cost =", cost)This script at the moment only asks for an input, then blanks out. Just a little lost on where i went wrong? i think it may be a math issue or a loop issue but I'm not sure