[Cialug] Algorithm

Chris Hilton cialug@cialug.org
Sat, 15 Jan 2005 20:36:19 -0600


The answer is always 0.  int(.92) is 0.  I don't see how you can do
integer arithmetic on a non-integer value. 
Surely you are reading the directions wrong somehow...

On Fri, 2005-01-14 at 20:32 -0600, Morris Dovey 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  (:
>