Create the logic for a program that continuously prompts the user for a number of dollars until the user enters 0. Pass each entered amount to a conversion method that displays a breakdown of the passed amount into the fewest bills; in other words, the method calculates the number of 20's, 10's, 5's and 1's as needed

2 answers

dollars=1
loop while dollars > 0
bills = breakdown(dollars)
end loop

breakdown(n)
twenties = int(n/20)
n -= twenties
tens = int(n/10)
n -= tens
fives = int(n/5)
n -= fives
ones = n
return(twenties,tens,fives,ones)
oops. The steps in breakdown should be
n -= twenties*20
and so on for the other bills.