Perl: the Markov chain saw | |
PerlMonks |
Re: Simple but thought-provoking programming tasks [OT]by johngg (Canon) |
on Apr 16, 2007 at 08:54 UTC ( [id://610291]=note: print w/replies, xml ) | Need Help?? |
Similar to bobf's suggestion, many, many moons ago I did the weekly wage packets where I worked. These were paid in cash and one of things you had to work out was what denomination notes and coins would you need from the bank. Given that Fred needed £305.27, Mary needed £387.43 and Bill was to recieve £287.94, how do you break up the total of £980.64 so that you could make up each pay packet exactly, always using the highest denomination possible, i.e 8p would be 5p + 2p + 1p, not 4 x 2p or 8 x 1p. I hope this is of interest. Cheers, JohnGG
In Section
Seekers of Perl Wisdom
|
|