package recursion; import static lib.IO.*; public class ChangeIncomplete { // value of available coins private static int[] cents = {1, 2, 5, 10, 20, 50}; public static void main(String[] args) { int cents = 20; int numPossibilities = change(cents); println("There are " + numPossibilities + " possibilities to change " + cents +" cents."); } public static int change(int money) { return change(money, cents.length-1); } /** * Returns the number of possibilities to change money into smaller coins. * @param money value to subdivide into coins * @param indexLargestCoin number of smaller pieces left to try changing * @return number of possibilities to change money */ private static int change(int money, int indexLargestCoin) { if (indexLargestCoin == 0) return 1; else { // TODO // edit *only* this part of the program } } }