Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 19 21 2012 Proceedings Part 3 Lnai 7198

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284922, 978-3642284922

More Books

Students also viewed these Databases questions