Question: Write the class to represent a member. Include the following components: a constant to represent the current year of 2 0 2 4 instance data

Write the class to represent a member. Include the following components:
a constant to represent the current year of 2024
instance data variables:
a namethe year the member joined (stored as an int)whether or not the member is a VIP
a constructor that sets all of the instance data variables using parameters
getter and setter methods
in your setter for the year, use validity checking to make sure the parameter is valid before assigning it to the instance data variable
a toString method
include the name and year joined in the text representationif the member is a VIP, include that in the text as wellyou can see my example of the formatting in the sample output below (note that I used tabs in my formatting)
You should iteratively write, compile, and test each of these components while writing your class to make sure each works before moving on.
Part Two: Class Method (5 points)
Write a method that determines whether a member is a "founding member." A founding member is defined as a member who is both a VIP and has been a member for at least ten years.
Part Three: Driver Class (5 points)
Write a driver class with a main method that does each of the following:
create six Member objects using the data below
create an ArrayList of members and fill it with the six objects
use a loop to print a text representation of each member
count and output the number of members who have been members for less than three years
count and output the number of founding members
Additional Coding Requirements (5 points)
code should compile
follow Java naming conventions for classes (upper camel case) and for variables and methods (lower camel case with no underscores)
choose the best loops and conditional structures for a task
use constants instead of hard-coded values when possible to improve clarity and readability and to make code easier to maintain
reduce duplicated code (consider how to replace repeated code with a method)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!