Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Example Test Code:Below is an example of the test code that can be used for testing your programs public static void main ( String args

Example Test Code:Below is an example of the test code that can be used for testing your programs public static void main(String args[])
{
HospitalDatabase hd = new HospitalDatabase();
hd.showAllPatients();
hd.addPatient("Michael Johnson","Emma Thompson", 19,12,2022);
hd.addPatient("Ethan Lee", "Olivia Sanchez", 8,9,2020);
hd.addPatient("Noah Miller", "Olivia Sanchez", 27,2,2019);
hd.addPatient("Liam Davis", "Isabella Martinez", 3,4,2022);
hd.addPatient("Ava Taylor", "Isabella Martinez", 15,5,2024);
hd.addPatient("Mason Moore", "William Anderson", 7,6,2021);
hd.addPatient("Charlotte Garcia", "Lucas Lewis", 30,10,2023);
hd.addPatient("Noah Miller", "Olivia Sanchez", 27,2,2019);
hd.showAllPatients();
hd.removePatient("Ava Taylor");
hd.showAllPatients();
hd.showPatient("Michael Johnson");
hd.addMember("Mason Moore", "Daniel Roberts", "Nurse");
hd.addMember ("Mason Moore", "Victoria Stewart", "Radiologist");
hd.addMember ("Mason Moore", "Tyler Campbell", "Medical Assistant");
hd.addMember ("Mason Moore", "Hannah Martin", "Paramedic");
hd.addMember ("Michael Johnson", "Jack Allen", "Patient Care
Technician");
hd.addMember ("Michael Johnson", "Oliver Nelson", "Anesthesiologist");
hd.addMember ("Michael Johnson", "Sophia Rivera", "Pathologist");
hd.addMember ("Michael Johnson", "Evan Hall", "Laboratory Technician");
6
hd.addMember ("Michael Johnson", "Megan Price", "Nurse");
hd.addMember ("Ava Taylor", "Brianna Reed", "Dietitian");
hd.addMember ("Charlotte Garcia", "Oliver Nelson", "Anesthesiologist");
hd.addMember ("Charlotte Garcia", "Trevor Jenkins", "Medical Equipment
Technician");
hd.addMember ("Charlotte Garcia", "Justin Flores", "Speech-Language
Pathologist");
hd.showPatient("Mason Moore");
hd.showPatient("Michael Johnson");
hd.removeMember("Michael Johnson", "Evan Hall");
hd.showPatient("Michael Johnson");
hd.showDoctorPatients("Olivia Sanchez");
hd.showDoctorPatients("Emma Thompson");
hd.showPatients(2022);
System.exit(0);
} Output of the Example Test Code:
For the test code that is given above, you will see the following output on the screen.
---none---
INFO: Patient Michael Johnson has been added
INFO: Patient Ethan Lee has been added
INFO: Patient Noah Miller has been added
INFO: Patient Liam Davis has been added
INFO: Patient Ava Taylor has been added
INFO: Patient Mason Moore has been added
INFO: Patient Charlotte Garcia has been added
ERROR: Patient Noah Miller overwritten
Noah Miller, 2019, Olivia Sanchez
Ethan Lee, 2020, Olivia Sanchez
Mason Moore, 2021, William Anderson
Liam Davis, 2022, Isabella Martinez
Michael Johnson, 2022, Emma Thompson
Charlotte Garcia, 2023, Lucas Lewis
Ava Taylor, 2024, Isabella Martinez
INFO: Patient Ava Taylor has been removed
Noah Miller, 2019, Olivia Sanchez
Ethan Lee, 2020, Olivia Sanchez
Mason Moore, 2021, William Anderson
Liam Davis, 2022, Isabella MartinezMichael Johnson, 2022, Emma Thompson
Charlotte Garcia, 2023, Lucas Lewis
Michael Johnson
19/12/2022
Emma Thompson
INFO: Daniel Roberts has been added to the patient Mason Moore
INFO: Victoria Stewart has been added to the patient Mason Moore
INFO: Tyler Campbell has been added to the patient Mason Moore
INFO: Hannah Martin has been added to the patient Mason Moore
INFO: Jack Allen has been added to the patient Michael Johnson
INFO: Oliver Nelson has been added to the patient Michael Johnson
INFO: Sophia Rivera has been added to the patient Michael Johnson
INFO: Evan Hall has been added to the patient Michael Johnson
INFO: Meghan Price has been added to the patient Michael Johnson
ERROR: Patient Ava Taylor does not exist
INFO: Oliver Nelson has been added to the patient Charlotte Garcia
INFO: Trevor Jenkins has been added to the patient Charlotte Garcia
INFO: Justin Flores has been added to the patient Charlotte Garcia
Mason Moore
7/6/2021
William Anderson
Daniel Roberts, Nurse
Hannah Martin, Paramedic
Tyler Campbell, Medical Assistant
Victoria Stewart, Radiologist
Michael Johnson
19/12/2022
Emma Thompson
Evan Hall, Laboratory Technician
Jack Ellen, Patient Care Technician
Meghan Price, Nurse
Oliver Nelson, Anesthesiologist
Sophia Rivera, Pathologist
INFO: Evan Hall has been removed from the patient Michael Johnson
Michael Johnson
19/12/2022
Emma Thompson
Jack Ellen, Patient Care Technician
Meghan Price, Nurse
Oliver Nelson, Anesthesiologist
Sophia Rivera, PathologistOlivia Sanchez
Ethan Lee, 8/9/2020
Noah Miller, 27/2/2019
Emma Thompson
Michael Johnson, 19/12/2022
2022
Michael Johnson, 19/12
Liam Davis, 3/4 use this test code and rewrite the all code according the expected output.

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

SQL Server Query Performance Tuning

Authors: Sajal Dam, Grant Fritchey

4th Edition

1430267429, 9781430267423

More Books

Students also viewed these Databases questions