How do I go about coding this program in Java?
Write a class called PocketChange that models a handful of change you
might find in your pocket. The class has the following specifications:
Instance Variables - all instance variables are private!
o int toonies - the number of toonies in the user's pocket
o int loonies - the number of loonies in the user's pocket
o int quarters - the number of quarters in the user's pocket
o int dimes - the number of dimes in the user's pocket
o int nickels - the number of nickels in the user's pocket
o int pennies - the number of pennies in the user's pocket
Methods:
o PocketChange() - default constructor assigns 0 as a default value
to all instance variables.
o PocketChange(toonies, loonies, quarters, dimes, nickels,
pennies) - sets the values of all the instance variables to the
programmer-specified parameter values.
o Accessor and mutator methods for each instance variable - all
coin values must be 0 or positive values. Exceptions should be
thrown if an attempt is made to set an instance variable to a
negative value.
o calcAmount() - This method calculates and returns the total
amount of money in the user's pocket, based on the values in
each of the instance variables.
o toString() - returns a String with the following format:
o Toonies: t
o Loonies: L
o Quarters: q
o Dimes: d
o Nickels: n
Pennies: p
where t, L, q, d, n, and p are the number of toonies, loonies, quarters,
dimes, nickels and pennies.