Hello, I am hoping that somebody can help to provide some guidance on this for me. I am tasked with writing this class for a Java class I'm taking:
Write a class encapsulating the concept of coins, assuming that coins have the following attributes: a number of quarters, a number of dimes, a number of nickels, and a number of pennies. Include a constructor, the accessors and mutators and methods toString and equals. Also code the following methods: one returning the total amount of money in dollar notation with two significant digits after the decimal point, and others returning the money in quarters ( for instance, 0.75 if there are three quarters ), in dimes, in nickels, and in pennies. Write a class to test all methods in your class.
First, I'm somewhat confused if I need to write two classes, one to encapsulate the concept of coins and one to test all methods in the class or one class to handle all demands.
I'm comfortable with setting the accessor and mutator methods and such but I'm confused on how this should be structured initially to start this. I'm unable to get to campus to work with the tutor due to a sick child so I'm hoping I can get some guidance here to build on. Thanks for the time.