As part of your second assignment, you are required to alter the code from your previous work (Assignment 1) and enhance it using inheritance.
In addition to classes you have already implemented, you should create two new classes that would be inheriting their common attributes from another class as shown below (see
Figure 1).
Figure 1: Inheritance Hierarchy
You should create Student and Academic classes as subclasses of the RegularMember class, since these two classes have common attributes with the RegularMember class. You should
access common attributes with the help of the “super” keyword. Furthermore, any existing private attributes should be updated as “protected” to be able to use these fields throughout
the inheritance hierarchy.
Additionally, you should alter the existing Book and OnlineArticle variables of the Reader class with an array of the corresponding class type. The RegularMember class should beable to store only 1 Book and 1 OnlineArticle. On the other hand, the Student class should
be able to store up to 2 Books and 2 OnlineArticles and the Academic class should be able to store 3 Books and 3 OnlineArticles. In order to follow good programming practices, all functionally of these classes should be implemented using setters and getters.Accordingly,
the books and online article objects should be set using specialized methods such as addBook(Book b) and addOA(OnlineArticle oa). The reserved book and accessed online article counts should be controlled with these methods.
The menu should be modified as follows:
1. Add a new book
2. Add a new Online Article
3. Create a member account
4. Reserve a book
5. Get access to an online article
6. Display all accounts
7. Exit.
When the user press 3rd option to create a reader account a sub-menu should appear as
follows:
1. Create a regular member account
2. Create a student member account
3. Create an academic member account
If the user chooses the 1st option, a RegularMember class object should be created.
Respectively, if the user selects the 2nd option a Student account and if 3rd option selects
the Academic account should be created. All regular, student, and academic member
accounts should be stored in the same array.
If the user presses the 6th option in the main menu, the program should iterate through the
member array and display the reserved books and accessed online articles of all member
accounts. To be able to do this you should add a displayInfo() method to your
RegularMember, Student, and Academic classes.
Submit your assignments in a zip file, which has your student number as
name, through the





