Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Exercise 4 . 4 2 Membership of a club is represented by an instance of the Membership class. A complete version of Membership is already
Exercise Membership of a club is represented by an instance of the Membership class. A complete version of Membership is already provided for you in the club project, and it should not need any modification. An instance contains details of a person's name and the month and year in which they joined the club. All membership details are filled out when an instance is created. A new Membership object is added to a Club abject's collection via the Club object's join method, which has the following description: Add a new member to the club's collection of members. eparam member The member object to be added. public void join Membership member Complete the join method. in Chapter Grouping Objects When you wish to add a new Membership object to the Club object from th object bench, there are two ways you can do this. Either create a new Membe object on the object bench, call the join method on the Club object, and d the Membership object to supply the parameter or call the join method on club object and type into the method's parameter dialog box: new Membership member name month, year Each time you add one, use the number fMembers method to check both the join method is adding to the collection and that the numberofMembe method is giving the correct result. We shall continue to explore this project with some further exercises later chapter.
Exercise Membership of a club is represented by an instance of the Membership class. A complete version of Membership is already provided for you in the club project, and it should not need any modification. An instance contains details of a person's name and the month and year in which they joined the club. All membership details are filled out when an instance is created. A new Membership object is added to a Club abject's collection via the Club object's join method, which has the following description:
Add a new member to the club's collection of members.
eparam member The member object to be added.
public void join Membership member
Complete the join method.
in
Chapter Grouping Objects
When you wish to add a new Membership object to the Club object from th object bench, there are two ways you can do this. Either create a new Membe object on the object bench, call the join method on the Club object, and d the Membership object to supply the parameter or call the join method on club object and type into the method's parameter dialog box:
new Membership member name month, year
Each time you add one, use the number fMembers method to check both the join method is adding to the collection and that the numberofMembe method is giving the correct result.
We shall continue to explore this project with some further exercises later chapter.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started