Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE HELP ME WITH PROBLEMS 1 AND 2. I WANT A COMPILED SOURCE CODE WITH OUTPUT. Problem 1. (50 points) Alice is going to create

image text in transcribedPLEASE HELP ME WITH PROBLEMS 1 AND 2. I WANT A COMPILED SOURCE CODE WITH OUTPUT.image text in transcribed

Problem 1. (50 points) Alice is going to create a notebook including the profile of all her friends. For each of her friends, she would like to keep first-name, last-name, cell number, and birthdate (month and day). At the beginning, she doesn't know how many spaces she should reserve for recording her friends, so she gradually inputs her friends' information into it Please help her by first creating a Java class, called Person, with the required information from description above, along with any required setter/getter methods. (10 points) . Then create, a Java class, called FriendsList, that keeps the list of some persons as someone's friends, using the Person class above, and performs the required operations, such as add new friends delete/ modify an existing one, return the list of her friends sorted by last-names, report the number of her friends, report the list of her friends who born in a given month sorted by their day of birth, and report the list of her friends who born in a given day of a month, sorted by their last-names. She also needs to get the cell number of a friend by giving her/his first-name and last-name. (25 points) Create a tester class, called MyFriends, to test the FriendList class by creating a new object of this class, adding some friends, modifying and deleting some existing friends, retrieving and printing all friends, retrieving and printing the list of friends who born in a given month, retrieving and printing the list of friends who born in a given day of a month, and finding the cell number of an existing friend by giving her/his first-name and last-name. Also, create a separate copy of the FriendList object you have already created, and remove all friends with first-name "Shane" from the new object. (15 points) Java file names: Person.Java, FriendList.java, and MyFriends.java Problem 2. (70 points) In this problem, we are going to reuse the Person class created in the previous problem. Therefore, first make sure that you have already created Person.java based on the description provided above. Modify the Person class, by implementing Comparable interface. Therefore, you should implement the unimplemented method from the Comparable interface inside the Person class. For comparing to persons, compare their last-names followed by their first-names. (5 points) Create a subclass of Person, called Employee, such that it can keep extra information of a person including year of hiring, annual salary, vacation days, and unused vacation days. Provide required setter/getter methods for this class. (15 points) Create a subclass of Employee, called Manager, which also has monthly bonus, and the list of all her/his employees. Provide required setter/getter methods for this class. (15 points) Create a class, called Company, with the following information: name of the company, starting year, and the list of all its employees/managers. Provide required setter/getter methods for this class. (15 points) Create a tester class, called MyCompany, in which you should test all the above classes by creating a company, adding some employees/managers into it, two listings of the company's employees/managers, one sorted by last-names, and one sorted by each manager and then herhis employees. (20 points) Java file names: Person.Java, Employee.java, Manager.java, Company java, and MyCompany.java Note: As we have same classes Person.java in both problems above, you just need to have the one from the second problem, that is also able to handle the first

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions