Reply To: Programming
The mystery of the silver bullet › Forums › The Intelligence Room › Programming › Reply To: Programming
The heading of this thread is Programming so it is not all about math solving.
On that basis here is
======================================================== Question #3
WAYS WITH MONEY
In how many ways can UK 1 pound (100 pence) be given as change using all the UK coins?
UK Coins are: 1p,2p,5p,10p,20P,50p,£1(100p) and £2(200p), we disregard the £2 coin here.
HERE ARE THE THE FIRST FIVE AND LAST FIVE SETS THAT MY CODE GAVE
I have edit replaced some values with a ? (else it would give the answer away)
\\ ===================== PROGRAM OUTPUT ======================
\\ set#) coin count of(coin value)
\\ 1) 0(1p) 0(2p) 0(5p) 0(10p) 0(20p) 0(50p) 1(100p)
\\ 2) 0(1p) 0(2p) 0(5p) 0(10p) 0(20p) 2(50p) 0(100p)
\\ 3) 0(1p) 0(2p) 0(5p) 3(10p) 4(20p) 1(50p) 0(100p)
\\ 4) 0(1p) 0(2p) 0(5p) 4(10p) 2(20p) 1(50p) 0(100p)
\\ 5) 0(1p) 0(2p) 0(5p) 5(10p) 0(20p) 1(50p) 0(100p)
\\ ?) 95(1p) 0(2p) 0(5p) 0(10p) 1(20p) 0(50p) 0(100p)
\\ ?) 95(1p) 0(2p) 1(5p) 0(10p) 0(20p) 0(50p) 0(100p)
\\ ?) 96(1p) 2(2p) 0(5p) 0(10p) 0(20p) 0(50p) 0(100p)
\\ ?) 98(1p) 1(2p) 0(5p) 0(10p) 0(20p) 0(50p) 0(100p)
\\ ?) 100(1p) 0(2p) 0(5p) 0(10p) 0(20p) 0(50p) 0(100p)
\\ The number of possible ways (sets) is: ?
================= TASK
Write Code (function) and have it display the first and last TEN sets similar to the above.
SHOW YOUR CODE AND ITS OUTPUT