# Program to make change # Matt Bishop, January 18, 2012 # for ECS 10 Winter 2012 # set flag for looping go_on = "yes" # # loop making change until told to quit # while go_on == "yes": # get the amount to make change for temp = input("How many cents do you want me to make change for? ") change = pchange = int(temp) # take out the qurters nquarters = change // 25 change %= 25 # take out the dimes ndimes = change // 10 change %= 10 # take out the nickels nnickels = change // 5 # what's left are the pennies npennies = change % 5 # give the change print(pchange, "cents is", nquarters, "quarters,", ndimes, "dimes,", nnickels, "nickels, and ", npennies, "pennies") # do another one? go_on = input("Again ('yes' for yes, anything else to stop): ")