

-----------------------------------

Slnj

Sat Mar 27, 2010 9:31 pm


Lowest amount of bills/coins

-----------------------------------

What is the problem you are having?
Im stuck 

Questions : Write a program that inputs a dollar amount and outputs how the amount can be represented using the fewest number of bills and coins. Hint: Use the mod and div commands.


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)

I have tried doing it on my own but got stuck beacuse say if i put $150 as the amount of money it will only says 1 hundred dollar bill and it won't say 1 fifty dollar bill. 



var money, a , b, c, d: real
put "What is the amount of money? "
get money

if money >=100 then 
 a := money div 100 put money, " hundred dollar bill(s)"   
elsif money =50  then 
 b := money div 50 put b," fifty dollar bill(s)"
elsif money 