Question
A hospital is a very busy place with a lot of teachers and a lot of staff. All patients in the hospital have basic information
A hospital is a very busy place with a lot of teachers and a lot of staff.
All patients in the hospital have basic information like name, gender, address, email, and phonenumber.
Staff at the hospital have extra information like Staff-id and salary.
i. For every department are 5 doctors. There is a Dept_HeadDoctor who is also a doctor but gets an allowance of 10% more than the salary of a doctor.
ii. There are also Nursing Staff and Ambulance Staff iii. Nursing Staff are assigned to a specific department like Orthopedic, Cardiac, Pediatric and Dermatology
Then, there are two types of patients in the hospital,
i. The Inpatient and the Outpatient
ii. While both have all the basic information, the Inpatients will have a room number and cost of stay assigned to them.
First draw a UML to represent the given class.
Then, create the base class (superclass) and subclasses to represent this scenario.
Write a separate test module where 6 instances of the class are created, and themethods are tested by giving the required details and printing the details for each class.
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