Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Translate into java code patient, department and hospital classes and Write a test class with main method to test the above classes. Please write the

image text in transcribedimage text in transcribed

Translate into java code patient, department and hospital classes and Write a test class with main method to test the above classes.

Please write the answer, and pictures for simple run

* If you can explain it by commenting, I would be grateful to you

Patient Department - patientid: int - patientname: String - patientage : double - DepartmentName: String - Departmentid: int + Patient (id:int, name: string, age: double) - ArrayPatient [] : Patient + setters/getters + Department (DeptName: String, Size: int) + display ( ) : void + read () : void + addpatient (patient p): void + search (patid : int) : void + deletepatient (patid: int) : void + DisplayAll() Hospital - Name: String - ArrayDepartment []: Department + Hospital (size:int) + AddDepartment ( departmentname: String, departmentid:int) : void + search ( DepartmentName: String): int + deletedepartment (DepartmentName: String): int +DisplayAll() Class Patient: Attribute: Patientid, Patientname, Patientage Method: Patient (id:int, name: string, age: double): Constructor getter/setter: Create the get and set method to each and every attribute Display ( ) : Displays patient id name and age Read (): this method reads the attributes of the patient from keyboard. Class Department Attribute: Departmentname, Deapartmentid, Arraypatient. Methods: Department (DeptName: String, Size: int): Constructor Addpatient (patient p): this method adds the patient to array search (patid : int) : this method should search in department for a particular id and display the patient details. deletepatient (patid: int) : this method should delete the patient from the department DisplayAll (): this method prints the attributes of all the objects that belong to patient Class Hospital: The class Hospital has the same functionality as Department

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

More Books

Students also viewed these Databases questions

Question

Explain FIVE (5) positive impacts on a database accounting system.

Answered: 1 week ago

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago