Question 697725: Using pennies, nickels, dimes, quarters, fifty-cent pieces, and dollar coins there are 293 different combinations of coins that add up to exactly one dollar. But the modern British system of money has different kinds of coins. The main British unit of currency is the pound, which is split into 100 pence. British coins are the pence, tuppence (two pence), five-pence, ten-pence, 20-pence, 50-pence, and one-pound coin. How many ways are there to make one pound out of British coins?
Answer by Edwin McCravy(20059) (Show Source):
You can put this solution on YOUR website!
I suppose this is a computer science course you are taking, for there
is no way this can be solved with ordinary counting methods of mathematics
courses. I used LibertyBasic with the program below. You can download a
free trial copy of LibertyBasic at
http://www.libertybasic.com/
The output was 4563
---------------------------------------
for pound = 0 to 1
for fifty = 0 to (100-100*pound)/50
for twenty = 0 to (100-100*pound-50*fifty)/20
for ten = 0 to (100-100*pound-50*fifty-20*twenty)/10
for five = 0 to (100-100*pound-50*fifty-20*twenty-10*ten)/5
for two = 0 to (100-100*pound-50*fifty-20*twenty-10*ten-5*five)/2
DISABLED_event_one= 100-100*pound-50*fifty-20*twenty-10*ten-5*five-2*two
count=count+1
next
next
next
next
next
next
print count
Edwin
|
|
|