Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PART I: The superclass Employee and its two subclasses Doctor and Nurse. Employee - name: String - YOB: int - gender: char - baseSalary: double
PART I: The superclass Employee and its two subclasses Doctor and Nurse. Employee - name: String - YOB: int - gender: char - baseSalary: double + Employee () + Employee (--all parameters-- ) + setters/getters + toString(): String Hospital - name: String employees: ArrayList + Hospital (name: String) + getters + addNurse (n: Nurse): void + addDoctor (d: Doctor): void + toString(): String + countNurse(): int + countFemale Doctor(): int + searchDoctor(doctorName: String): Doctor Doctor - specialty: String + Doctor (--all Parameters--) + setter/getter + toString (): String Nurse - service: String + Nurse (--all parameters-- ) + setter/getter + toString (): String PART 2: The class Hospital Question 1 (40 pts): Implement all the data fields and methods represented in the UML diagram of the class Hospital. Note: . . data fields, constructor, toString and getters. [10pts] The addNurse method adds a Nurse object to the employees list. [6pts] The addDoctor method adds a Doctor object to the employees list. [6pts] The countNurse method counts the number of nurses in the employees list. [6pts] The countFemaleDoctor counts the number of female doctors in the employees list. [7pts] The searchDoctor searches a doctor by his name in the employees list, if found the method return the doctor, if not the method returns null (return null). [5pts]
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