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
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
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
complete in java

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
This is a popular solution!
Step by step
Solved in 2 steps with 1 images

Knowledge Booster
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.Recommended textbooks for you

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education