Question
Design and implement a set of classes that define the employees of an hospital: doctor, nurse, administrator, surgeon, receptionist, janitor. Include methods in each class
Design and implement a set of classes that define the employees of an hospital: doctor, nurse, administrator, surgeon, receptionist, janitor. Include methods in each class that are named according to the services provided by that person and that print an appropriate message. Create a main driver class to instantiate and exercise several of the classes.
Adding a UI that allows the user to enter information that will be used to create the different objects, and displays the information.
Note:
Think about inheritance, extract all the common characteristics and behaviors into a superclass and have the subclasses inherit them. The subclasses should each have at least one characteristic and one behavior that is different from the super class. Instead of giving each type of employee a different name for what he does, use the same name: duty as the method name to override the duty method in the super class.Apply the overriding mechanism to the toString method as well.
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