Posted by william on Thursday, November 17, 2011 at 12:21pm.
do your homework
start
Declarations
num dollars
dollars = inputDollarAmt()
while dollars <> 0
dollarConversion(dollars)
dollars = inputDollarAmt()
endwhile
stop
num inputDollarAmt()
Declarations
num dollars
num QUIT = 0
output “Enter a dollar amount or ”, QUIT, “ to quit”
input dollars
return dollars
void dollarConversion(num dolls)
Declarations
num twenties
num tens
num fives
num ones
twenties = dolls / 20
dolls = dolls % 20
tens = dolls / 10
dolls = dolls % 10
fives = dolls / 5
dolls = dolls % 5
ones = dolls
output “You will need: ”, twenties, “ 20s, ”, tens, “ 10s, ”,
fives, “ 5s, and ”, ones, “ 1s”
return