Hello all I am new to Python and I am taking a programming class but I can't seem to figure out what I am doing wrong to get the programming correct. I have the following but it isn't working correctly.
print ("Change Calclator")
quarter = .25
dime = .10
nickel = .05
penny = .01
moneygiven = int(input("Enter how much money given: "))
citem = int(input("How much did the item cost?: "))
moneygiven = int(float(moneygiven) 100)
citem = int(float(citem) 100)
moneyback = int(float(moneygiven - citem))
qmb = moneyback / quarter
partialtotal = int(float(moneyback - qmb quarter))
dmb = partialtotal / dime
dpartialtotal = int(float(partialtotal - dmb dime))
nmb = dpartialtotal / nickel
npartialtotal = int(float(dpartialtotal - nmb nickel))
pmb = npartialtotal / penny
ppartialtotal = int(float(npartialtotal - pmb penny))
print ("You need %s quarters, %s dimes, %s nickels, %s pennies.")
This is what happens when I run the program
Change Calclator
Enter how much money given: 99
How much did the item cost?: 55
You need %s quarters, %s dimes, %s nickels, %s pennies.
However it is supposed to tell me this information
- The program should display the minimum number of quarters, dimes, nickels, and pennies that one needs to make up the specified number of cents.
- Assume that the user will enter a valid integer for the number of cents.
- The program should continue only if the user enters "y" or "Y" to continue.
I think that I may not have enough information listed in my source code or I may not have the correct information but either way I am lost. If anyone can point me in the right direction it is definitely appreciated.