Question: Write a class called Person that has a name and ID# for variables. It should have a get and set for each variable, constructor, copy

Write a class called Person that has a name and ID# for variables. It should have a get and set for each variable, constructor, copy constructor, equals method and toString method. A person should also have a favorite number that is less than 100.

9. Write a class called Student that inherits from Person. It should have an array called CoursesTaken and it should redefine the ID# so that it can only be set to a 7 digit Student ID. Use the Person constructor and for this class. The favorite number of a Student can only be between 100 and 200.

10. Write a class called Worker that inherits from Person. It should have a variable for job and the requisite get/set methods. It should have override the equals method - two Workers will be

equal if they have the same job. The favorite number of a Worker can only be between 200 and 300

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 Databases Questions!