Beefy Boxes and Bandwidth Generously Provided by pair Networks
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??


in reply to Simple but thought-provoking programming tasks [OT]

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

  • Comment on Re: Simple but thought-provoking programming tasks [OT]

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://610291]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-24 10:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found