I am so confuse how to code this.
what ever the total change is lets say $2.78 have to make it come out to be how many dollars, quarters, dime, nickels , penny.
but i just dont know how to use the Mod operator to do it.
this is is wat i did so far.
but it dont work gives me a error if i have something like
change mod .25 ... error is division by zero. and it wont work. wats wrong?
curDollars = curTotalChange \ 1
intRemainder1 = curTotalChange Mod 1
intQuarters = intRemainder1 / 0.25
intRemainder2 = intRemainder1 Mod 0.25
intDimes = intRemainder2 / 10
.........
even the dollars dont work :( can some one please help.
2007-03-04
17:01:06
·
1 answers
·
asked by
asmi.rani
3
in
Computers & Internet
➔ Programming & Design