Coin Dispenser
Create two files:  CoinDispenser.java and CoinCall.java

CoinDispenser.java
  • a constructor class (no 'main' method and no keyword 'static')
  • simulates a cash register change machine that automatically dispenses coins
  • contains a single constructor
    - takes one argument, the number of cents to be dispensed
  • contains a non-static method named "calculate"
    - takes no arguments
    - dispenses the fewest number of coins possible
    - displays the number of quarters, dimes, nickels, and pennies to be dispensed
    - creates neatly-formatted output, similar to what is shown below
    - does not return anything

CoinCall.java
  • a calling class
  • uses the "Scanner" class
  • does not perform any error trapping
  • contains a 'main' method
    - asks for, and gets from the user, an integer number of cents
    - creates a "CoinDispenser" object using the supplied number of cents
    - calls the "calculate" method in the "CoinDispenser" class


Sample Program Run #1
=====================
Enter the amount of change (in cents):  37

 37 cents =>
  Quarters:    1
  Dimes:       1
  Nickels:     0
  Pennies:     2


Sample Program Run #2
=====================
Enter the amount of change (in cents):  168

 168 cents =>
  Quarters:    6
  Dimes:       1
  Nickels:     1
  Pennies:     3


Sample Program Run #3
=====================
Enter the amount of change (in cents):  11

 11 cents =>
  Quarters:    0
  Dimes:       1
  Nickels:     0
  Pennies:     1