Question: Question: 1 interactive block DUE DATE No due date Unlimited Submissions Examine the provided Bookstore class. Currently, this project is missing the Member and PremiumMember
Question: interactive block
DUE DATE
No due date
Unlimited Submissions
Examine the provided Bookstore class. Currently, this project is missing the Member and PremiumMember classes
Your first task will be to add those classes. Use the following description to write the missing classes.
Member extends an abstract class Person
PremiumMember extends Member
Person has attributes: name String
Member has attributes: name String numberPurchasesint
PremiumMember has attributes: name String numberPurchasesint hasPaidDuesboolean
There should be getters and setters for each attribute, and the necessary constructors for those attributes.
Instead of having a setter for hasPaidDues, PremiumMember should have one a method called payDues that if hasPaidDues is false, switches the value to true.
Next, navigate to the Bookstore class. Notice that there are two types of ArrayList, one for each type of Member. Change this so that both member types use the same ArrayList.
Finally, scroll to line There is a partial method called registerNewMember that needs to be finished. Complete the method so that a new Member can enter their name and be added to the list of members. You shouldn't need to edit any other part of the main method. After a member is added, you should be able to confirm they were added correctly by using the Check Member Status option in the menu
I will upvote if code is correct, and runs properly, thank you
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
