PPT Slide
public class ChangeMakerByComposition
/* Uses compositional approach to make change. Computes the number of
quarters, dimes, nickels and pennies in an amount less than a dollar and
{ private int quarter = 25, dime = 10, nickel = 5,
number_of_quarters, number_of_dimes, number_of_nickels,
number_of_pennies, amount;
private int[] coin_and_balance = new int[2];
public static void main(String[] args)
System.out.println("Enter a whole number from 1 to 99.");
amount = SavitchIn.readLineInt();
coin_and_balance = number_and_balance
number_of_quarters = coin_and_balance[0];