Use an IDE for this assignment and create a package called ER - put the three files in the package. In this assignment, you will create an application that will simulate the patients in an emergency room and how long they wait before they are seen. Every patient is assigned a priority from 1 to 10 (1 is the most important and 10 is the least important). The patients will be read in from the file PatientData.txt which has each record (line) as

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter11: Exception Handling
Section: Chapter Questions
Problem 4E
icon
Related questions
Question

complete in java

Use an IDE for this assignment and create a package called ER – put the three files in the package. In this
assignment, you will create an application that will simulate the patients in an emergency room and how
long they wait before they are seen. Every patient is assigned a priority from 1 to 10 (1 is the most
important and 10 is the least important). The patients will be read in from the file PatientData.txt which
has each record (line) as
icetlame, lastNamE, patientlR, year, month, day, priority
Create classes as follows
Patient with 4 attributes - firstName, lastName, patientID (7 digits, cannot begin with 0), DOB.
Add constructors and other methods.
ERCase with 3 attributes – Patient, priority, timeWaitiog, Add constructors and other methods.
This class must implement the interface Comparable<ERCase> and implement the method
public int compareTe(ERCase c)
EmergencyRoom- uses a Priority Queue to manage the patients in the ER waiting room. Add 5
cases to the Priority Queue at the start of the simulation. Then in each time cycle possibly add
cases and possibly remove cases. For each time cycle the probability that 0, 1, 2 or 3 patients
arrive at the ER are 20%, 30%, 30% and 20% respectively. For each time cycle, the probabilities
that 0, 1 or 2 patients are seen (leave the Priority Queue) are 25%, 50% and 25% respectively.
In EmergencyRoom there are two parts to the simulation
In the first part, the program runs through 10 cycles printing information on patients who arrive
and patients who leave during each cycle. Error information should also be printed if there is
incorrect data in the text file. Pause the output after each cycle so that we can clearly see what
is happening.
In the second part, the program will reset everything from part 1, add 5 cases and then run
through 75 cycles without printing anything. After running it will print summary data: how many
patients arrived at the ER, how many have been seen and what was the average wait time for
those who have been seen.
Other Information
• You must include clear comments in your code so that I can follow what you did when
grading. You should also methods (functions) in EpergencyBoom to simplify the code.
• Store DOB as an object - one possibility is LocalDate
• Java has a PrioritvQueue.class so use it to create a PrioritvQueue<EBCase> to manage
the cases in the EmergenCvRoon.
Use exception-handling when reading from the text file data. You can ignore any record that has
errors - your program will just read the next line.
Concentrate on making output readable and understandable.
Transcribed Image Text:Use an IDE for this assignment and create a package called ER – put the three files in the package. In this assignment, you will create an application that will simulate the patients in an emergency room and how long they wait before they are seen. Every patient is assigned a priority from 1 to 10 (1 is the most important and 10 is the least important). The patients will be read in from the file PatientData.txt which has each record (line) as icetlame, lastNamE, patientlR, year, month, day, priority Create classes as follows Patient with 4 attributes - firstName, lastName, patientID (7 digits, cannot begin with 0), DOB. Add constructors and other methods. ERCase with 3 attributes – Patient, priority, timeWaitiog, Add constructors and other methods. This class must implement the interface Comparable<ERCase> and implement the method public int compareTe(ERCase c) EmergencyRoom- uses a Priority Queue to manage the patients in the ER waiting room. Add 5 cases to the Priority Queue at the start of the simulation. Then in each time cycle possibly add cases and possibly remove cases. For each time cycle the probability that 0, 1, 2 or 3 patients arrive at the ER are 20%, 30%, 30% and 20% respectively. For each time cycle, the probabilities that 0, 1 or 2 patients are seen (leave the Priority Queue) are 25%, 50% and 25% respectively. In EmergencyRoom there are two parts to the simulation In the first part, the program runs through 10 cycles printing information on patients who arrive and patients who leave during each cycle. Error information should also be printed if there is incorrect data in the text file. Pause the output after each cycle so that we can clearly see what is happening. In the second part, the program will reset everything from part 1, add 5 cases and then run through 75 cycles without printing anything. After running it will print summary data: how many patients arrived at the ER, how many have been seen and what was the average wait time for those who have been seen. Other Information • You must include clear comments in your code so that I can follow what you did when grading. You should also methods (functions) in EpergencyBoom to simplify the code. • Store DOB as an object - one possibility is LocalDate • Java has a PrioritvQueue.class so use it to create a PrioritvQueue<EBCase> to manage the cases in the EmergenCvRoon. Use exception-handling when reading from the text file data. You can ignore any record that has errors - your program will just read the next line. Concentrate on making output readable and understandable.
Expert Solution
Step 1

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Constants and Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT