Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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"
image text in transcribed

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

Describe how language emerges.

Answered: 1 week ago

Question

What are weaknesses of the payback period

Answered: 1 week ago