Question: Attendee.java: Write a class called Attendee to represent one person who might attend the reunion. Your constructor should take the person s name and a
Attendee.java: Write a class called Attendee to represent one person who might attend the reunion. Your constructor should take the persons name and a Boolean if they have RSVPd to the reunion as parameters. Store these values in instance variables. Provide getters and setters for each. Also add a toString method so when an object of type Attendee is printed, it outputs the persons name.
Graduate.java: Create a subclass of Attendee called Graduate to represent one Dartmouth graduate who may attend the reunion. Graduates are attendees and in addition to the parameters stored by Attendee, each graduate should also have a numeric graduation year eg and a department eg Computer Science Provide the needed parameters in a constructor, saving them in instance variables. If a Graduate is printed it should have the same output the same as an Attendee but should append the year and department. For example: Elvis Computer Science.
Reunion.java: Complete a class called Reunion to track people who may attend. The constructor should accept and store the maximum number of attendees, and should have one array note: use an array, not an ArrayList! that can hold up to the max parameter number of Attendee or Graduate objects. Additionally,
Provide one method eg not two overloaded methods called addAttendee for your Reunion class that takes an object of either type Attendee or Graduate as a parameter and adds it to the array at the next open spot in your array. This method should print an error message and return if attempting to add more than the maximum number of attendees including those people rvsp'ed false If a person is successfully added to the array, print "Added rsvp: where is a String representation of the person examples below, especially Alice and Charlie and is their rsvp status.
Provide a method called rsvp for your Reunion class that takes a persons name as a String and a Boolean indicating if they have RSVPd as parameters. Search the array of Attendees and update the persons RSVP status if an attendees name matches the name parameter assume no duplicate names Print not found if no attendees names match, where is the name parameter. Otherwise, print the attendee's name and new rsvp status.
Finally, provide a toString method that will produce a String representation of a Reunion object in the format shown below. Make sure to be efficient! eg loop through the array one time
Starting with this scaffold code, your code should produce the following output
Added Alice, rsvp: true
Added Bob, rsvp: false
Added Charlie Government, rsvp: true
Added Denise Econ, rsvp: false
Added Elvis Computer Science, rsvp: true
Unable to accommodate Falcon Biology, max attendees is
Reunion attendees that have RSVP:
Alice
Charlie Government
Elvis Computer Science
Reunion attendees that have NOT RSVP:
Bob
Denise Econ
Update rsvp status
George not found
Set RSVP to true for Bob
Reunion attendees that have RSVP:
Alice
Bob
Charlie Government
Elvis Computer Science
Reunion attendees that have NOT RSVP:
Denise Econ
Submission Instructions
Turn in your completed Java code for Attendee, Graduate, and Reunion in one zip file. Make sure your output matches the output above.
public class Reunion
TODO: your code here
public static void mainString args
Reunion r new Reunion;
raddAttendeenew AttendeeAlice true;
raddAttendeenew AttendeeBob false;
raddAttendeenew GraduateCharlie true, "Government";
raddAttendeenew GraduateDenise false, "Econ";
raddAttendeenew GraduateElvis true, "Computer Science";
raddAttendeenew GraduateFalcon false, "Biology";
System.out.printlnr;
System.out.println;
System.out.printlnUpdate rsvp status";
rrsvpGeorge false; print not found
rrsvpBob true; update
System.out.printlnr;
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
