Answered step by step
Verified Expert Solution
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
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 DepartmentStep 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