CSS 145 Oregon State University ExpenseAccount Class Java Project
DescriptionIn this assignment, you will update the Money, Date, Bill, and ArrayList classes from previous homeworks - (I have this available) - using new ideas that we have discussed in class, and you will create an ExpenseAccount class extending your ArrayList. Build a driver that will fully check the functionality of your classes and include the driver with your submission.Fix any privacy (and other) errors that were noted in your comments for the previous iteration of this homework.Modify the Money, Date, and Bill class to implement the Comparable interface. Remember that compareTo takes an Object parameter and you should check to make sure that the object that comes in is actually the correct class for the comparison, as appropriate. (How could the CompareTo method be implemented for Bill? If you were sorting a collection of Bills, how would you want them sorted? Make a reasonable choice and document your choice.)Modify the Money, Date, and Bill classes to implement the Cloneable interface. Note that Money and Date can simply copy their private instance variables, since they store only primitive and immutable types. However, you will need to override the clone method, to make it public, since it is protected in the Object class. The Bill class will need to do more, since it incorporates the Money and Date classes, which are mutable. Note that it can (and should) use the clone methods of those classes. Be sure to remove any use of the copy constructor for Money, Date, and Bill in the rest of the code (the definition can exist, but don’t use it in other classes; use the clone method instead).Build a class ExpenseAccount that extends your ArrayList. (Reminder: you are using YOUR ArrayList, not the built in Java one.) You should remove the limit on the number of bills that can be placed in an account by making your ArrayList dynamically resize itself. (You may do this either by resizing an internal array, or by implementing your ArrayList as a linked list. If your ArrayList is implemented as a linked list (for instance, by inheriting from the general List class that you made in the "Linked Lists, Stacks & Queues" homework), then make sure to include any of these other classes when you turn in this assignment.) The ExpenseAccount class is essentially an ArrayList of Bills. Your ExpenseAccount must include AT LEAST one method that you don't just inherit from the ArrayList class. What should it have? What would be useful for an expense account to have? That's for you to answer!Modify Money, Bill, and Date to implement the Serializable interface.(See for example: http://tutorials.jenkov.com/java-io/serializable.html (Links to an external site.) and https://www.tutorialspoint.com/java/java_serialization.htm (Links to an external site.) )OPTIONAL, FOR 3 POINTS OF EXTRA CREDIT: Have your ArrayList class implement the Iterable interface. Implement the Java 7 specification, not later specifications like Java 8. That is, see: http://docs.oracle.com/javase/7/docs/api/java/lang/Iterable.html The Java 8 specification includes resources to support functional programming and lambda expressions which is out of the scope of this class. Make sure your driver tests the iterable aspects of your class. (For example, you should be able to use a for each loop with your ArrayList.) If you are doing this, please submit a Canvas comment with your submission to the effect of "Extra credit: my ArrayList implements the Iterable interface", so my grader knows to check for it. Note: this is not necessarily easy. None of the students were able to figure it out last time I taught this.Build a driver that will fully check the functionality of all your classes and include the driver with your submission.Hints, Etc.Remember to follow the Coding Style Guidelines.Make sure you comment all methods and the class with javadoc comments. This includes constructors, getters, setters, etc. If you have files based on code someone else has written (e.g., is based on a skeleton), you have to javadoc comment the methods someone else wrote also. You cannot receive full-credit for the rubric's commenting criterion if you do not have a javadoc comment for every method, no matter how small. All methods should have pre- and post-conditions as well.Your code should not depend on absolute path specifications or any other environment-specific specifications. The program should not ask for user input from the console.The description for this assignment is much briefer than in some previous assignments. In particular, not much detail is given regarding what methods to have, etc. It is purposely open-ended. By this point, you should be able to design an appropriate interface to your classes as well as create an appropriate driver filled with tests. My advice is not to scrimp on the interface; include all methods one would reasonably expect objects of that class would be able to do.Classes whose names are given in this assignment description should be given that name. If you submit multiple versions, Canvas will rename your files with a "-1", etc. suffix, but that's okay. We can handle that change. But the base name of your class has to be as described.An example of questions to ask when defining an interface (for the ExpenseAccount class): What kind of data and methods should go into an ExpenseAccount class? What would you use an ExpenseAccount for? What would you want to inquire of an expense account? (If you don't know what an expense account is, do some web searches to find out.) For instance, you might be interested in knowing the total amount of expenses that is outstanding in the ExpenseAccount. You might be interested in knowing which expense is next due and unpaid and how much it is. And so on ... these are just two examples of questions you might ask of an expense account. It depends on the use cases you want the expense account to satisfy. These kinds of questions can also be asked for Bill, etc.What to turn in: Money.javaDate.javaBill.javaExpenseAccount.javaArrayList.javaany other classes you need to implement the aboveDriver.java