Whether you're coding in BASIC or Python, add the ability for the Cash Register program we built together to dispense change. If the price is $23.72 and the customer hands you $40, you're going to need to make change for $16.28.....so the program should test for $20 bills (won't fit), $10 bills (1 fits, leaving $6.38), $5 bills (1 fits, leaving $1.38), $1 bills (1 fits, leaving .38), quarters (1 fits, leaving .13), dimes (1 fits, leaving .03), nickels (none fits) and pennies for what's left. So the program has calculated the amount due ($23.72) and the teller inputs amount given ($40) and the program feeds back change denominations something like this (or more elegantly):$20: 0$10: 1$5: 1$1: 1.25: 1.10 1.05: 01: 3BASIC code is below.http://calormen.com/applesoft
10 HOME
20 PRINT "CASH REGISTER"
30 PRINT
40 SUBTOTAL = 0
50 GTOTAL = 0
60 RATE = 0.06
70 TAX = 0
80 PRINT "ENTER -1 FOR ITEM PRICE TO FINISH ADDING ITEMS"
90 PRINT
1000 REM INPUT ITEMS
1010 INPUT "ENTER ITEM PRICE "; ITEM
1020 IF ITEM = -1 THEN 2000
1030 SUBTOTAL = SUBTOTAL + ITEM
1040 PRINT "ADDING $";ITEM;"... NEW SUBTOTAL: $";SUBTOTAL
1050 GOTO 1010
2000 REM SUBTOTAL + TAX + TOTAL
2010 PRINT "Subtotal = $";SUBTOTAL
2020 TAX=SUBTOTAL*RATE
2021 PRINT "TAX RATE = ";RATE
2030 GTOTAL = SUBTOTAL + TAX
2040 PRINT "$";SUBTOTAL;" + $";TAX;" = $";GTOTAL
2050 PRINT "PLEASE PAY ";GTOTAL
3000 REM MAKE CHANGE
3010 INPUT "HOW MUCH MONEY DID CUSTOMER GIVE YOU? ";CASH
3020 CHANGE = CASH - GTOTAL
3030 PRINT "GIVE THEM BACK ";CHANGE
3040 INPUT "NEXT CUSTOMER? (1 = YES) ";CUSTOMER
3050 IF CUSTOMER = 1 THEN 10
3060 END