ÜuTiName. lastName, patient|R, year, month, day, priority classes as follows Patient with 4 attributes - ficstlame, lastiNamme, patientlR (7 digits, cann Add constructors and other methods. ERCase with 3 attributes – Patient, priority, timeWaitiog. Add constructo This class must implement the interface Comparable and impl

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
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
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY