Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in java In this lab, you will be creating a program to track patients waiting in the lobby of the emergency room. When patients enter
in java
In this lab, you will be creating a program to track patients waiting in the lobby of the emergency room. When patients enter the waiting room, they are assigned an injury-severity level between 1 and 20,1 needing the most urgent attention and 20 needing the least attention. People with a lower injury-severity level values are seen before people with high injury-severity level values. A patient's injury-severity level can change as they are waiting (for example, if someone comes in for a broken wrist but starts to have a heart attack, they're going to get moved up in priority). You will need to make sure you still have a heap after the value is changed!l!! At ABC hospital, doctors treat patients in order of severity, then by age, then in alphabetical order. Create a program to track when patients are treated. You will prompt the user to enter the injury-severity level, name, and age of new patients. The user could enter as many patients as needed. Next, you will have doctors attending to the patients. In a perfect world, doctors could spend as much time as they needed with each patient. However, there are a limited number of doctors and a potentially unlimited number of patients. There is a cool way to schedule the occurrence of a doctor calling a patient using timers and threading in lava, but for the sake of time we won't cover them. Feel free to explore on your own. In this simulation, the patients check themselves in with your program, and doctors use your program to see who to visit next. The doctors (users) will ask you to either print an entire list of the people who are waiting, or to call the next person back. Time is not an obstacle in this world - doctors will keep working until the waiting room is empty. Once the waiting room is empty, everyone goes home for the day. There are multiple ways to do this lab, but if you are struggling on where to start, I recommend breaking this into 3 files: - You need a class to define what a patient is - You need your class with your main method - You need a class to define how to compare patients - I called mine "ComparablePatient". (Java doesn't know what patients are). This class extends a different class and implements an interface. I'll leave that for you to determine Step 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