Question
This is heavily based on Programming Exercise 11.2 in the Liang text. However, you will not need the text version to do this assignment, many
This is heavily based on Programming Exercise 11.2 in the Liang text. However, you will not need the text version to do this assignment, many changes have been made.
The archive assign02.zip is attached has a skeleton project for this assignment. All the test programs are there that will be used to test your work. The different classes you are to implement are present in skeleton form.
Requirements
Implement classes Person, Student, Employee, Faculty and Staff. These represent the people and categories of people you might find at a college or university. These are related by inheritance as follows
Employee and Student both extend Person
Faculty and Staff both extend Employee
Here are the instance fields of each class:
Class | Instance Fields |
---|---|
Person | name email address |
Employee | salary date hiredB |
Faculty | office hours |
Staff | title |
Student | class statusA |
Here are the notes from the table:
This should be a string. The most common values will be one of FR, SO, JR, SE, but dont bother testing for that.
Use the standard Java Date class
Instance field types should be String except for salary and date hired.
The classes will have the following methods:
Getters and setters for all instance fields, except
Date hired has no setter
A single constructor in each class that initializes all the fields for that class both inherited and defined in the class itself, except for date hired For example, he Staff constructor will have 4 parameters: title, salary, name, and email address
The constructor for Employee will initialize the hire date to the current date
Override toString in each class to print the name of the class followed by the name of the person, separated by a colon. For example, if Bob is a staff member, his object would print as Staff:Bob.
format each program start like this for each role student-etc.
package assign02; import java.util.Date; public class Employee { }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started