[Cialug] Algorithm
Jerry Weida
cialug@cialug.org
Fri, 14 Jan 2005 22:14:45 -0600
Well, I can't do all the work. This /is/ someone's homework!
On Fri, 14 Jan 2005 20:32:06 -0600, Morris Dovey <mrdovey@iedu.com> wrote:
> Jerry Weida wrote:
>
> > not sure if this counts as "logic" but here's how I'd do it:
> >
> > quarters = amount / 25
> > amount = amount - quarters * 25
> > dimes = amount / 10
> > amount = amount - dimes * 10
> > nickels = amount / 5
> > amount = amount - nickels * 5
> > pennies = amount
>
> Jerry...
>
> Yabbut -- the initial value for amount is $0.92 (:
>
> --
> Morris Dovey
> West Des Moines, Iowa USA
>
> _______________________________________________
> Cialug mailing list
> Cialug@cialug.org
> http://cialug.org/mailman/listinfo/cialug
>