Java Programming using eclipse IDE
Task A: Complete Club Class:
Use the “Club” project in folder “SD1code/lab8” to complete the following exercises. (Instructions are as follows):
1. Within Club define a field for an ArrayList, which holds the current memberships. Use an appropriate import statement and think carefully about the
element type of the list. Don’t forget to instantiate the field in the constructor.
2. Membership of the club is represented by an instance of the Membership object. (You shouldn’t have to modify the existing membership class.) Complete the Join method in Club.
3. Write a main method, which adds two new members to the club and prints out the current size of the club.
Task B: Add methods to Club:
In this exercise, you have to ‘translate’ code documentation into code. First familiarize yourself with how to write documentation.
4.Add the joinedInMonth method to the Club class, which has the following description.
* Determine the number of members who joined in a given month.
* @param month The month we are interested in.
* @ return the number of members who joined in that month.
Public int joinedInMonth (int month)
5.Define a method in Club with the following description:
* Remove from the club’s collection all members who
* who joined in the given month, and return them
* stored in a separate collection object.
* @param month The month of the membership.
* @param year The year of the membership.
* @return The members who joined in the given month
* and year.
public ArrayList<Membership> purge (int month, int year)
As purge method is slightly more challenging than the other methods! Try using some of the other Iteration methods.
We can write this or a similar paper for you! Simply fill the order form!