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 III: The driver program Question 1 (30 pts): Write the driver program that will do the following: 1. Create a Hospital object with name read from the user. (5pts] 2. Add to the Hospital object 3 doctors and 1 nurse with data of your choice. [5pts] 3. Display the number of nurses in the Hospital object using the corresponding method in the Hospital class. [5pts] 4. Display the number of female doctors using the corresponding method in the Hospital class. [5pts] 5. Display the description of all doctors. [5pts] 6. Test the searchDoctor method by reading a doctor name from the user and displaying its description if it is available. [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_2

Step: 3

blur-text-image_3

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

Understanding Databases Concepts And Practice

Authors: Suzanne W Dietrich

1st Edition

1119827949, 9781119827948

More Books

Students also viewed these Databases questions