Question: Additional details for methods in each class: You are required to implement the following method in each class, following its respective description Person Class
Additional details for methods in each class: You are required to implement the following method in each class, following its respective description Person Class Appropriate getter and setter methods. toString(): Override this method to provide a meaningful string representation of the object. Martyr Class Appropriate getter and setter methods. toString(): Override this method to provide a meaningful string representation of the object. Live Person Class: toString(): Override this method to provide a meaningful string representation of the object. Family Class: addMember(Person member, String roleInFamily): Adds a person to the family with a specified role (The permitted roles include mom, dad, son, and daughter). removeMember(Person member): Removes a person from the family. getMembers(): Retrieves the list of family members. getFamilyName(): Retrieves the Family Name. setFamilyName(String familyName): set a name for family. addParent(Person parent): Adds a parent to the family. removeParent (Person parent): Removes a parent from the family. getParents(): Retrieves the list of family parents. toString(): Override this method to provide a meaningful string representation of the object. equals(Object obj): Override this method to consider two families as equal if they have the same number of martyrs. Manager Class: addFamily (Family family): Adds a new family to the system. updateFamily (String familyName, Family updatedFamily): Updates information about a family based on Family name. deleteFamily (String familyName): Deletes a family from the system based on Family name. searchByName(String familyName): Searches for a family based on Family name. searchPersonByID(String personID): Searches for a person based on their ID. calculate TotalMartyrs(): Returns the total number of martyrs in the system. calculate TotalOrphans(): Returns the total number of orphans in the system. Orphans are individuals whose parents (both mom and dad) have passed away. calculate TotalLive Persons(): Returns the total number of live persons in the system. calculate Family Statistics(String familyName): Returns statistics for a specific family, including the number of martyrs, orphans, and live persons. Store the returned values in ArrayList. calculate GlobalStatistics(): Returns overall statistics for the system. Store the returned values in ArrayList. toString(): Override this method to provide a meaningful string representation of the object. Page3
Step by Step Solution
3.47 Rating (163 Votes )
There are 3 Steps involved in it
In the Person class you need to implement getter and setter methods for the class attributes The toString method should be overridden to provide a mea... View full answer
Get step-by-step solutions from verified subject matter experts
