[Tutor] Ingenious script (IMO)

Kent Johnson kent37 at tds.net
Tue Aug 7 01:15:47 CEST 2007


Dick Moores wrote:
> At 02:17 PM 8/6/2007, you wrote:
>> Nice idea. Written style is average. Other tutors have discussed issues with
>> performance, style, etc. I thought I would mention that whenever I am asked
>> to give my opinion on a script, I compare it to something I have
>> written/would write. In this case, I have already written. In my version, it
>> not only tells how many of each denomination, but also how one would count
>> back the change. It would be an interesting challenge to implement that, no?
>> ;-)
> 
> First remind me how Americans do that. I lived in Japan a long time, 
> and it's done quite differently there.
> 
> For the U.S., say the output so far is:
> 
> Enter the cost: 5.77
> Enter the tendered amount: 10
> Your change is $4.23
> $1 bills:       4
> 10-cent coins:  2
> 1-cent coins:   3
> 
> What would be the U.S. way of counting back the change? I think we 
> start with the $5.77, but then what?

The traditional way starts from the cost and counts up to the amount 
tendered. So to make change from $10 for $5.77 you would count
three pennies -> $5.80
two dimes -> $6.00
four $1 -> $10

The modern way seems to be to look at the change amount given by the 
cash register and count that out starting with dollars...

Kent


More information about the Tutor mailing list