Question: Complete programming Exercise 11.2 on p. 445. Each class will be a separate Java file in your NetBeans project, plus another file PersonTest that demonstrates


Complete programming Exercise 11.2 on p. 445. Each class will be a separate Java file in your NetBeans project, plus another file PersonTest that demonstrates the classes (six files plus MyDate.java). While the logic in declaring and displaying data isn't tricky, you will need to understand subclasses and inheritance to complete the programming assignment. Note this modification to the instructions: instead of printing just the person's name, display ALL variables for each object. You will do this with calls to super, for example to display information about an Employee object, the Employee object will call super (i.e. Person's toStrinc method) for the variables they have in common Employee's method might look like this (output shown in example below). eOverride public string toString() {return super. toString() + Salary: "+salary + ", Date hired: " +dateHired;} For Faculty and Staff objects, you will overload toString in Employee. BE SURE to document your code and include your name and date at the top of EACH Java file Prepare a UML diagram (see example p. 411) before you start coding, and include it in your uploaded NetBeans project. Person Nare:Kim, Address: 123 Main St, Honolulu, Phone: kin@hpu.edu, Email:8theta85551212 Employee Nare:Joe, Address: 234 Main St., Honolulu, Phone: joe@hpu.edu. Email:8theta8S551213 Salary: 5 theta theta theta, Date hired: 6/1/17 Student Name:Lee, Address: 345 Main St., Honolulu, Phone: lee@hpu.edu, Email:8theta85551215 Status:Sophomore Faculty Narre:Sue, Address: 456 Main St., Honolulu, Phone: sue@hpu.edu, Email:8theta8555122theta Office Hours: 9:00-11:30, Rank: Assoc Professor Staff Name:Tim, Address: 567 Main St., Honolulu, Phone: bob@hpu.edu, Email:8theta85551225 Title: Administrator (The Prison, Student, Employee, Faculty, and Staff classes) Design a class named Person and its two subclasses named Student and Employee. 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. Use the MyDate class defined in Programming Exercise 10.14 to create an object for date hired 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. Draw the UML diagram for the classes and implement them. Write a test pro- gram that creates a Person. Student, Employee, Faculty, and Staff, and invokes their toString() methods. Complete programming Exercise 11.2 on p. 445. Each class will be a separate Java file in your NetBeans project, plus another file PersonTest that demonstrates the classes (six files plus MyDate.java). While the logic in declaring and displaying data isn't tricky, you will need to understand subclasses and inheritance to complete the programming assignment. Note this modification to the instructions: instead of printing just the person's name, display ALL variables for each object. You will do this with calls to super, for example to display information about an Employee object, the Employee object will call super (i.e. Person's toString method) for the variables they have in common Employee's method might look like this (output shown in example below). eOverride public string toString() {return super. toString() + Salary: "+salary + ", Date hired: " +dateHired;} For Faculty and Staff objects, you will overload toString in Employee. BE SURE to document your code and include your name and date at the top of EACH Java file Prepare a UML diagram (see example p. 411) before you start coding, and include it in your uploaded NetBeans project. Person Nare:Kim, Address: 123 Main St, Honolulu, Phone: kin@hpu.edu, Email:8theta85551212 Employee Nare:Joe, Address: 234 Main St., Honolulu, Phone: joe@hpu.edu. Email:8theta8S551213 Salary: 5 theta theta theta, Date hired: 6/1/17 Student Name:Lee, Address: 345 Main St., Honolulu, Phone: lee@hpu.edu, Email:8theta85551215 Status:Sophomore Faculty Narre:Sue, Address: 456 Main St., Honolulu, Phone: sue@hpu.edu, Email:8theta8555122theta Office Hours: 9:00-11:30, Rank: Assoc Professor Staff Name:Tim, Address: 567 Main St., Honolulu, Phone: bob@hpu.edu, Email:8theta85551225 Title: Administrator (The Prison, Student, Employee, Faculty, and Staff classes) Design a class named Person and its two subclasses named Student and Employee. 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. Use the MyDate class defined in Programming Exercise 10.14 to create an object for date hired 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. Draw the UML diagram for the classes and implement them. Write a test pro- gram that creates a Person. Student, Employee, Faculty, and Staff, and invokes their toString() methods
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
