Need advice/suggestion with recursive java program
Posted: Sat Feb 03, 2007 10:26 pm
Hi guys,
I would very much appreciate if someone can point me in the right direction with this assignment. I do not want the full-fledge code to solving this... i have gone half the distance already. only the recursive part I DO NOT UNDERSTAND
OK, here's the problem statement:
take the input from the user [using Scanner]
and pass it to the recursive method.
However, if someone can explain the workings of this darn method, that would be very helpful.
Thanks.
-Matt
I would very much appreciate if someone can point me in the right direction with this assignment. I do not want the full-fledge code to solving this... i have gone half the distance already. only the recursive part I DO NOT UNDERSTAND
OK, here's the problem statement:
What I have done so far - (basically everything except the recursive method):Write a recursive program which enumerates all the ways to give the change in coins (quarters,
dimes, nickels, pennies) for a given amount of money. That is, given a target sum s it should
produce a collection of arrays of size 4 (e.g., [8, 3, 1, 2], [9, 0, 2, 2], ... for a target amount of 2.37)
giving the number of coins of each type. The input to the program will be a single number given on
the standard input. The output will be a sequence of lines, where each line is a quadruple enclosed
in square brackets and the 4 numbers are separated by commas and denote the number of coins of
each denomination (quarter,dime,nickel,penny).
take the input from the user [using Scanner]
and pass it to the recursive method.
However, if someone can explain the workings of this darn method, that would be very helpful.
Thanks.
-Matt