Description

This is a very short assignment whose purpose is having you add several methods to the existing Tally class as defined in Tally.java and available as a file as part of this assignment. Your task is to add instance methods to the Tally class as specified below.

Specifications:
Add an instance method and variable that will allow the Tally class to place a maximum limit on the count possible. Modify the Tally class code to allow a maximum to be set after object instantiation. Also modify Tally class code so the constructor can take an argument that is the maximum size for a counter object. You should make sure that any other methods that change the count will not go above the limit. Notify the user they try to go over the maximum limit.

Add another instance method that undoes the last count increment operation. Be sure to check the value of the count and do NOT let it ever be less than zero. Be sure to notify the user if they try to make the count less than zero.

Lastly, add an instance method to the Tally class code that will report back the remaining space in our counter. (for instance, if the maximum count is 100 and the current count is 20, there is room for 80 more tallies.

You should test your class file with the TallyHoTester.java program provided with this assignment. You can add tests and see that all your class instance methods work correctly.

Write you modifications and rename the class and file with the new name TallyHo.java with the public class TallyHo. Submit your assignment with the name TallyHo.java.