Question: 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

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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!