Question: Bonus - Q 5 ( 2 points ) In Class Patient, write the code for the method to generatePatientIDO, which generates a unique patientID for

Bonus - Q5(2 points) In Class Patient, write the code for the method to generatePatientIDO, which
generates a unique patientID for each newly created patient object. The method should do the following:
a. generate an ID number consisting of 4-5 randomly generated numbers.
b. Makes sure the generated number is unique for each patient object (no two patients should
have the same patient ID).
c. set the patientID attribute to the created patient object when calling its constructor.
Reference: the method Math p,cdots.dotsn generates and returns a random number of type double
between 0 and 1, for exar ,,0.32-U.4,5, which are all of type double. You can use this
method to generate the '. You may use other
dom number generation methods.
Q6.(8 points) Consider t' below GUI for the log in screen for .e hospital management system.
In the last page, you can is.
write your code.
The following are the Todos:
1-(3 points) Write the full code for the above GUI (No Scene Buider or FXML) You program s
be called "Interface.java". Your code has to start from main.
2-(5 points) Implement the functionality of "Log in" button as follows:
a. Add an object reference called HospMan of type HospitalManagementSystem somev
your class (set it to public).
b. If the user clicks the button, your program should read the values from the Text fiel
ONLY, which are user name and password.
c. Then, In HospitalManagementSystem class, there are already two static arrayLists:
and doctors. Your program should:
i. Find the patient or doctor who has the same user name as the one in the GI
ii. Call the method validate (found in the abstract superelass "SystemUser")
object.
If the method validate retums true, you should print the message (in command line): "log in sup
otherwise, if the object with the same usemame is not found or vlaidate returns false: print out:
ailed"
 Bonus - Q5(2 points) In Class Patient, write the code for

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!