I have all but one line from the main class completed, I am just running into a dead end when working on the "plus" method.
"Create a USMoney class with two integer instance variables named dollars and cents. The class should have two accessor methods called getDollars and getCents. The class should have a constructor with two parameters for initializing a USMoney object. The constructor should check that the cents value is between 0 and 99 and, if not, transfer some of the cents to the dollars variable to make it between 0 and 99. (Note: You need not worry, though, for the purposes of this assignment, about reacting to and handling negative inputs to either of the two variables.)
Include in your class a method called plus that takes a USMoney object as an input parameter. This function should create and return a new USMoney object representing the sum of the calling object and the parameter. It does not modify the values of the two existing objects. Like the constructor, this method should ensure that the value of the cents instance variable of the returned object is between 0 and 99.
Provide Javadoc-style documentation (comments) for the 3 methods and the constructor of your USMoney class.
When you are finished,
you should be able to run the following main class:
with expected output as follows:
Account 2 data: 541 dollars and 43 cents
Account 1 data: 13 dollars and 57 cents
Account 3 data (sum): 555 dollars and 0 cents"
Any help would surely be appreciated
Thanks,
Cole