Make Faculty and Staff subclasses of Employee. A Person has a name, address, phone number, and e-mail 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.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter11: Advanced Inheritance Concepts
Section: Chapter Questions
Problem 2PE
icon
Related questions
Question

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 e-mail 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 program that creates a Person, Student, Employee, Faculty, and Staff, and invokes their toString() methods in output statements

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 8 steps with 2 images

Blurred answer
Knowledge Booster
Developing computer interface
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT