Here's an Update for Change:
Code: (Select All)
_Title "Change Update" ' b+ 2024-07-21
Dim a&(1 To 10), s$(1 To 10)
a&(1) = 5000: a&(2) = 2000: a&(3) = 1000: a&(4) = 500: a&(5) = 100
a&(6) = 50: a&(7) = 25: a&(8) = 10: a&(9) = 5: a&(10) = 1
s$(1) = "$50 bills": s$(2) = "$20 bills": s$(3) = "$10 bills": s$(4) = "$5 bills": s$(5) = "$1 bills"
s$(6) = "half dollars": s$(7) = "quarters": s$(8) = "dimes": s$(9) = "nickels": s$(10) = "pennies"
restart:
Print: Input "Enter amount to collect up to 100.00 (0 to quit)"; collect
If collect <= 0 Or collect > 100 Then End
Input "Enter amount paid "; paid
change = paid - collect
If change < 0 Then Print "You did not pay enough.": GoTo restart
If change = 0 Then Print "Thank you come again.": GoTo restart
c& = change * 100
For i = 1 To 10
amt& = Int(c& / a&(i)): TotChange = TotChange + amt& * a&(i)
If amt& Then c& = c& - amt& * a&(i): Print amt&; " "; s$(i)
Next
GoTo restart
b = b + ...