Question: Read the below system description carefuly: The below hospital system includes three classes: 1 - Patient: which includes basic information about patients. 2 - Doctor:

Read the below system description carefuly:
The below hospital system includes three classes:
1- Patient: which includes basic information about patients.
2- Doctor: which includes each doctor's information, and their assigned patients. Each doctor is assigne
to different patients, which are stored in the arrayList called patients.
3- HospitalManagementSystem: for managing different aspects of doctors, Assumptions and considerations:
1- You are not allowed to rip-off the papers.
2- Your code should be written to execute on a computer. Write complete code and correct code,
errors will be counted. Add comments if needed.
3- All setters and getters are already implemented.
4- Assume all import statements are already provided.
5- You may add extra methods or attributes to answer questions, however, use libraries or external code
at your own risk.
6- You must implement correct exception handling for checked exceptions.
Q1.(9 points). Implement the EVERYTHING in the UML Class diagram.
Q2.(2 point). In the class SystemUser, create the method boolean validate(String username_temp, String
password_temp). This method should return true if the attributes userName and password in the class
SystemUser are EXACTLY the same as the ones passed as arguments of the method (username_temp and
password_temp). Otherwise, the method should return false.
Q3.(8 points) In the the class HospitalManagementSystem, create the method called boolean save(), whi
does the following:
I. Create an a local variable of type arrayList that is of type DO, where DO is the inner class. C
the arrayList DOs.
II. Fill the arrayList DOs with objects of type DO, where each DO object corresponds to a doctc
to a patient stored in the arrayLists doctors and patients in the class HospitalManagementSys
The Dos should be as follows:
a. The attribute name in a Patient or Doctor object should be set to the DO's name attribute.
b. The DO ID attribute should be set according the object type:
i. If object is of type Doctor, the attribute id in DO should be the doctorID attribute of the
object.
ii. if the obje patients and appointment
Assume that the static arrayLists doctors and patients are already filled with all the doctors and patien
in the hospital.
4- DO: which will be used as data-object for saving information about patients and doctors.
Below is the UML class diagram
Assumptions and considerations:
1- You are not allowed to rip-off the papers.
2- Your code should be written to execute on a computer. Write complete code and correct code,
errors will be counted. Add comments if needed.
3- All setters and getters are already implemented.
4- Assume all import statements are already provided.
5- You may add extra methods or attributes to answer questions, however, use libraries or external code
at your own risk.
6- You must implement correct exception handling for checked exceptions.
Q1.(9 points). Implement the EVERYTHING in the UML Class diagram.
Q2.(2 point). In the class SystemUser, create the method boolean validate(String username_temp, String
password_temp). This method should return true if the attributes userName and password in the class
SystemUser are EXACTLY the same as the ones passed as arguments of the method (username_temp and
password_temp). Otherwise, the method should return false.
Q3.(8 points) In the the class HospitalManagementSystem, create the method called boolean save(), whi
does the following:
I. Create an a local variable of type arrayList that is of type DO, where DO is the inner class. C
the arrayList DOs.
II. Fill the arrayList DOs with objects of type DO, where each DO object corresponds to a doctc
to a patient stored in the arrayLists doctors and patients in the class HospitalManagementSys
The Dos should be as follows:
a. The attribute name in a Patient or Doctor object should be set to the DO's name attribute.
b. The DO ID attribute should be set according the object type:
i. If object is of type Doctor, the attribute id in DO should be the doctorID attribute of the
object.
ii. if the object is of type Patient, the attribute id in the DO should be patientID attribute o
object.
c. The DO enum attribute "type" should be set based on the object's type (to Doctor or to Patient),
object creation by calling the DO constructor. Add a comment with your name for an extra hal
III. Save all the DOs as objects to a file called SystemUsers.DB.
IV. The method should finally return return true if all objects have been written successfully,
otherwise returns false.
Q4.(8 points) In class SystemUser, create the static method called getID that returns the ID of an o
is passed as a parameter to the method, where the passed object can be an instance of the classes P_(c)
Doctor. For example if we call the code:
patient p1=new Patient("Salem, "Doha,22);
doctor d1=new Doctor("Rashid","23419",20400.0);
systemUser.getID(p1); // method will return the id of p1.
systemUser.getID(d1); // method will return 23419
 Read the below system description carefuly: The below hospital system includes

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!