Question: Java Homework:(The Person, Student, Employee, Faculty , and Staff classes) Design a class named Person and its two subclasses named Student and Employee . Make
Java Homework:(The Person, Student, Employee, Faculty, and Staff classes) Design a class named Person and its two subclasses named Student andEmployee. Make Faculty and Staff subclasses of Employee. A person has a name, address, phone number, and email address. A student has a class status (freshman, sophomore, junior, or senior). Define the status as a constant. An employee has an office, salary, and date-hired. Define a class named MyDate that contains the fields year, month, and day. A faculty member has office hours and a rank. A staff member has a title. Override the toString method in each class to display the class name and the person's name.
class Person{ //A person has a name, address, phone number, and email address. String name; String address; String phone; String email; rn} rnclass Student extends Person{ //A student has a class status //(freshman,sophomore, junior, or senior). //Define the status as a constant. final int freshman =1; final int sophomore =2; final int junior=3; final int senior=4; int status=freshman; rn} rnclass Employee extends Person{ //An employee has an office, salary, and date hired. String office; double salary; java.util.Date dateHired; rn} rnclass Faculty extends Employee{ //A faculty member has office hours and a rank. String officeHours; String rank; }rn class Staff extends Employee{ //A staff member has a title String title; rn} rnpublic class ex112{ } Step by Step Solution
3.37 Rating (153 Votes )
There are 3 Steps involved in it
public class person private String name address phone email public person public personString n String ad String pho String ema thisname n thisaddress ... View full answer
Get step-by-step solutions from verified subject matter experts
