SlideShare a Scribd company logo
package s3;
// Copy paste this Java Template and save it as "EmergencyRoom.java"
import java.util.*;
import java.io.*;
// write your matric number here:
// write your name here:
// write list of collaborators here:
// year 2016 hash code: XAbyuzR78fXeaMHBdLan (do NOT delete this line)
class patientlist {
private String PatientName;
private int emergencyLvl;
public patientlist(String PatientName, int emergencyLvl) {
this.PatientName = PatientName;
this.emergencyLvl = emergencyLvl;
}
public String getPatientName() {
return PatientName;
}
public void setPatientName(String PatientName) {
this.PatientName = PatientName;
}
public int getEmergencyLvl() {
return emergencyLvl;
}
public void setEmergencyLvl(int emergencyLvl) {
this.emergencyLvl = emergencyLvl;
}
}
class EmergencyRoom {
// if needed, declare a private data structure here that
// is accessible to all methods in this class
private List patientlist;
public EmergencyRoom() {
// Write necessary code during construction
patientlist = new ArrayList();
}
void ArriveAtHospital(String patientName, int emergencyLvl) {
// You have to insert the information (patientName, emergencyLvl)
// into your chosen data structure
if (patientName.length() > 15 || patientName.length() < 1) {
System.out.println("patient name is either too long or too short. Please enter a name between 1
to 15 characters.");
} else if (emergencyLvl > 100 || emergencyLvl < 30) {
System.out.println("Emergency level is either too high or too low. Please enter a valid level
between 30 to 100.");
} else {
int i;
for (i = 0; i < patientlist.size(); i++) {
if (patientlist.get(i).getPatientName().compareToIgnoreCase(patientName) == 0) {
System.out.println("Patient already admitted");
break;
}
}
if (i == patientlist.size()) {
patientlist p = new patientlist(patientName.toUpperCase(), emergencyLvl);
patientlist.add(p);
}
}
}
void UpdateEmergencyLvl(String patientName, int incEmergencyLvl) {
// You have to update the emergencyLvl of patientName to
// emergencyLvl += incEmergencyLvl
// and modify your chosen data structure (if needed)
int i;
for (i = 0; i < patientlist.size(); i++) {
if (patientlist.get(i).getPatientName().compareToIgnoreCase(patientName) == 0) {
//System.out.println("Patient already admitted");
//break;
if (incEmergencyLvl > 70 || incEmergencyLvl < 0) {
System.out.println("Emergency level is either too high or too low. Please enter a valid
increment between 0 to 70.");
break;
} else {
patientlist.get(i).setEmergencyLvl(patientlist.get(i).getEmergencyLvl() + incEmergencyLvl);
}
}
}
}
void Treat(String patientName) {
// This patientName is treated by the doctor
// remove him/her from your chosen data structure
int i;
for (i = 0; i < patientlist.size(); i++) {
if (patientlist.get(i).getPatientName().compareToIgnoreCase(patientName) == 0) {
patientlist.remove(i);
}
}
}
String Query() {
String ans = "The emergency room is empty";
int i;
if(patientlist.isEmpty())
return ans;
else{
int max=patientlist.get(0).getEmergencyLvl();
int pos=0;
for (i = 1; i < patientlist.size(); i++) {
if (patientlist.get(i).getEmergencyLvl()>max) {
max=patientlist.get(i).getEmergencyLvl();
pos=i;
}
}
return patientlist.get(pos).getPatientName();
}
// You have to report the name of the patient that the doctor
// has to give the most attention to currently. If there is no more patient to
// be taken care of, return a String "The emergency room is empty"
}
void run() throws Exception {
// do not alter this method
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
PrintWriter pr = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
int numCMD = Integer.parseInt(br.readLine()); // note that numCMD is >= N
while (numCMD-- > 0) {
StringTokenizer st = new StringTokenizer(br.readLine());
int command = Integer.parseInt(st.nextToken());
switch (command) {
case 0:
ArriveAtHospital(st.nextToken(), Integer.parseInt(st.nextToken()));
break;
case 1:
UpdateEmergencyLvl(st.nextToken(), Integer.parseInt(st.nextToken()));
break;
case 2:
Treat(st.nextToken());
break;
case 3:
pr.println(Query());
break;
}
}
pr.close();
}
public static void main(String[] args) throws Exception {
// do not alter this method
EmergencyRoom ps1 = new EmergencyRoom();
ps1.run();
}
}
Solution
package s3;
// Copy paste this Java Template and save it as "EmergencyRoom.java"
import java.util.*;
import java.io.*;
// write your matric number here:
// write your name here:
// write list of collaborators here:
// year 2016 hash code: XAbyuzR78fXeaMHBdLan (do NOT delete this line)
class patientlist {
private String PatientName;
private int emergencyLvl;
public patientlist(String PatientName, int emergencyLvl) {
this.PatientName = PatientName;
this.emergencyLvl = emergencyLvl;
}
public String getPatientName() {
return PatientName;
}
public void setPatientName(String PatientName) {
this.PatientName = PatientName;
}
public int getEmergencyLvl() {
return emergencyLvl;
}
public void setEmergencyLvl(int emergencyLvl) {
this.emergencyLvl = emergencyLvl;
}
}
class EmergencyRoom {
// if needed, declare a private data structure here that
// is accessible to all methods in this class
private List patientlist;
public EmergencyRoom() {
// Write necessary code during construction
patientlist = new ArrayList();
}
void ArriveAtHospital(String patientName, int emergencyLvl) {
// You have to insert the information (patientName, emergencyLvl)
// into your chosen data structure
if (patientName.length() > 15 || patientName.length() < 1) {
System.out.println("patient name is either too long or too short. Please enter a name between 1
to 15 characters.");
} else if (emergencyLvl > 100 || emergencyLvl < 30) {
System.out.println("Emergency level is either too high or too low. Please enter a valid level
between 30 to 100.");
} else {
int i;
for (i = 0; i < patientlist.size(); i++) {
if (patientlist.get(i).getPatientName().compareToIgnoreCase(patientName) == 0) {
System.out.println("Patient already admitted");
break;
}
}
if (i == patientlist.size()) {
patientlist p = new patientlist(patientName.toUpperCase(), emergencyLvl);
patientlist.add(p);
}
}
}
void UpdateEmergencyLvl(String patientName, int incEmergencyLvl) {
// You have to update the emergencyLvl of patientName to
// emergencyLvl += incEmergencyLvl
// and modify your chosen data structure (if needed)
int i;
for (i = 0; i < patientlist.size(); i++) {
if (patientlist.get(i).getPatientName().compareToIgnoreCase(patientName) == 0) {
//System.out.println("Patient already admitted");
//break;
if (incEmergencyLvl > 70 || incEmergencyLvl < 0) {
System.out.println("Emergency level is either too high or too low. Please enter a valid
increment between 0 to 70.");
break;
} else {
patientlist.get(i).setEmergencyLvl(patientlist.get(i).getEmergencyLvl() + incEmergencyLvl);
}
}
}
}
void Treat(String patientName) {
// This patientName is treated by the doctor
// remove him/her from your chosen data structure
int i;
for (i = 0; i < patientlist.size(); i++) {
if (patientlist.get(i).getPatientName().compareToIgnoreCase(patientName) == 0) {
patientlist.remove(i);
}
}
}
String Query() {
String ans = "The emergency room is empty";
int i;
if(patientlist.isEmpty())
return ans;
else{
int max=patientlist.get(0).getEmergencyLvl();
int pos=0;
for (i = 1; i < patientlist.size(); i++) {
if (patientlist.get(i).getEmergencyLvl()>max) {
max=patientlist.get(i).getEmergencyLvl();
pos=i;
}
}
return patientlist.get(pos).getPatientName();
}
// You have to report the name of the patient that the doctor
// has to give the most attention to currently. If there is no more patient to
// be taken care of, return a String "The emergency room is empty"
}
void run() throws Exception {
// do not alter this method
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
PrintWriter pr = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
int numCMD = Integer.parseInt(br.readLine()); // note that numCMD is >= N
while (numCMD-- > 0) {
StringTokenizer st = new StringTokenizer(br.readLine());
int command = Integer.parseInt(st.nextToken());
switch (command) {
case 0:
ArriveAtHospital(st.nextToken(), Integer.parseInt(st.nextToken()));
break;
case 1:
UpdateEmergencyLvl(st.nextToken(), Integer.parseInt(st.nextToken()));
break;
case 2:
Treat(st.nextToken());
break;
case 3:
pr.println(Query());
break;
}
}
pr.close();
}
public static void main(String[] args) throws Exception {
// do not alter this method
EmergencyRoom ps1 = new EmergencyRoom();
ps1.run();
}
}

More Related Content

PDF
Objective Min-heap queue with customized comparatorHospital emerg.pdf
PDF
Need help with this Java practice project. Im brand new to coding s.pdf
PDF
Patient.java package A9.toStudents; public class Patient imple.pdf
DOCX
Hospital management system
PDF
Hospital management project_BY RITIKA SAHU.
PDF
Sorting Questions (JAVA)See attached classes below.Attached Clas.pdf
PDF
programming Code in C thatloops requesting information about patie.pdf
PDF
Here is how the code works1. Patient.java is an Abstract Class whi.pdf
Objective Min-heap queue with customized comparatorHospital emerg.pdf
Need help with this Java practice project. Im brand new to coding s.pdf
Patient.java package A9.toStudents; public class Patient imple.pdf
Hospital management system
Hospital management project_BY RITIKA SAHU.
Sorting Questions (JAVA)See attached classes below.Attached Clas.pdf
programming Code in C thatloops requesting information about patie.pdf
Here is how the code works1. Patient.java is an Abstract Class whi.pdf

Similar to package s3; Copy paste this Java Template and save it as Emer.pdf (11)

PDF
Kupdf.com 292609858 computer-science-c-project-on-hospital-management-system-...
PDF
Priority Queue as a Heap ArrayEmergency Room Patient AdmittanceO.pdf
PDF
Computer Science class 12
PDF
Ive already completed the Java assignment below, but it doesnt wor.pdf
PDF
package patienttest;import java.util.Comparator; import java..pdf
DOCX
Hospital Managment System Project Proposal
PDF
public class Patient extends Person {=========== Properties ====.pdf
TXT
Hospital management
TXT
Hospital management
PDF
Question I need help with c++ Simple Classes Assigment. i get this .pdf
PDF
Below is my program, I just have some issues when I want to check ou.pdf
Kupdf.com 292609858 computer-science-c-project-on-hospital-management-system-...
Priority Queue as a Heap ArrayEmergency Room Patient AdmittanceO.pdf
Computer Science class 12
Ive already completed the Java assignment below, but it doesnt wor.pdf
package patienttest;import java.util.Comparator; import java..pdf
Hospital Managment System Project Proposal
public class Patient extends Person {=========== Properties ====.pdf
Hospital management
Hospital management
Question I need help with c++ Simple Classes Assigment. i get this .pdf
Below is my program, I just have some issues when I want to check ou.pdf
Ad

More from arakalamkah11 (20)

PDF
Particulars $Amount Direct materials 64452 Direct Labour (1332.pdf
PDF
Decrease in inventory Source of cash $   440 Decrease in account.pdf
PDF
Diamond is sp3 covalent. It makes for bonds to ne.pdf
PDF
Too low. If you do not dry the sodium thiosulfate.pdf
PDF
1. A bus is a bunch of wires used to connect multiple subsystems. Bu.pdf
PDF
1. E) The vapor pressure of a liquid.Increasing attractive intermo.pdf
PDF
Light is a form of energy that can be released by.pdf
PDF
1) Presence of jaws with paired fins in fish helps to feed them. Fin.pdf
PDF
Youre looking for Ka, the dissociation constant.pdf
PDF
Okay so dipole-dipole interactions would occur be.pdf
PDF
remote operating system installationRemote Installation Services (.pdf
PDF
Title of this process is The Project Life Cycle (Phases)The pr.pdf
PDF
The answer is A) Pol II, with twelve subunits on its own, is capable.pdf
PDF
solutionA=  1    1    0    4    3    1    2    0 .pdf
PDF
Q1). Gene therapy is an experimental approach to treat the disease b.pdf
PDF
Solution Three modes of DNA replication 1) Semi conservative.pdf
PDF
Our body is having two line defence system against pathogens.Pathoge.pdf
PDF
Once neurons are produced, they migrate and modify to form six layer.pdf
PDF
PDU is called Protocol Data Unit.It consists of user data and protoc.pdf
PDF
1.A hole is the absence of an electron in a particular place in an a.pdf
Particulars $Amount Direct materials 64452 Direct Labour (1332.pdf
Decrease in inventory Source of cash $   440 Decrease in account.pdf
Diamond is sp3 covalent. It makes for bonds to ne.pdf
Too low. If you do not dry the sodium thiosulfate.pdf
1. A bus is a bunch of wires used to connect multiple subsystems. Bu.pdf
1. E) The vapor pressure of a liquid.Increasing attractive intermo.pdf
Light is a form of energy that can be released by.pdf
1) Presence of jaws with paired fins in fish helps to feed them. Fin.pdf
Youre looking for Ka, the dissociation constant.pdf
Okay so dipole-dipole interactions would occur be.pdf
remote operating system installationRemote Installation Services (.pdf
Title of this process is The Project Life Cycle (Phases)The pr.pdf
The answer is A) Pol II, with twelve subunits on its own, is capable.pdf
solutionA=  1    1    0    4    3    1    2    0 .pdf
Q1). Gene therapy is an experimental approach to treat the disease b.pdf
Solution Three modes of DNA replication 1) Semi conservative.pdf
Our body is having two line defence system against pathogens.Pathoge.pdf
Once neurons are produced, they migrate and modify to form six layer.pdf
PDU is called Protocol Data Unit.It consists of user data and protoc.pdf
1.A hole is the absence of an electron in a particular place in an a.pdf
Ad

Recently uploaded (20)

PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Institutional Correction lecture only . . .
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
A systematic review of self-coping strategies used by university students to ...
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
RMMM.pdf make it easy to upload and study
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Classroom Observation Tools for Teachers
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
Cell Structure & Organelles in detailed.
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
Anesthesia in Laparoscopic Surgery in India
Institutional Correction lecture only . . .
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Supply Chain Operations Speaking Notes -ICLT Program
O7-L3 Supply Chain Operations - ICLT Program
A systematic review of self-coping strategies used by university students to ...
2.FourierTransform-ShortQuestionswithAnswers.pdf
RMMM.pdf make it easy to upload and study
Pharmacology of Heart Failure /Pharmacotherapy of CHF
O5-L3 Freight Transport Ops (International) V1.pdf
Classroom Observation Tools for Teachers
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
VCE English Exam - Section C Student Revision Booklet
human mycosis Human fungal infections are called human mycosis..pptx
STATICS OF THE RIGID BODIES Hibbelers.pdf
Cell Structure & Organelles in detailed.
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS

package s3; Copy paste this Java Template and save it as Emer.pdf

  • 1. package s3; // Copy paste this Java Template and save it as "EmergencyRoom.java" import java.util.*; import java.io.*; // write your matric number here: // write your name here: // write list of collaborators here: // year 2016 hash code: XAbyuzR78fXeaMHBdLan (do NOT delete this line) class patientlist { private String PatientName; private int emergencyLvl; public patientlist(String PatientName, int emergencyLvl) { this.PatientName = PatientName; this.emergencyLvl = emergencyLvl; } public String getPatientName() { return PatientName; } public void setPatientName(String PatientName) { this.PatientName = PatientName; } public int getEmergencyLvl() { return emergencyLvl; } public void setEmergencyLvl(int emergencyLvl) { this.emergencyLvl = emergencyLvl; } } class EmergencyRoom { // if needed, declare a private data structure here that // is accessible to all methods in this class private List patientlist; public EmergencyRoom() { // Write necessary code during construction patientlist = new ArrayList();
  • 2. } void ArriveAtHospital(String patientName, int emergencyLvl) { // You have to insert the information (patientName, emergencyLvl) // into your chosen data structure if (patientName.length() > 15 || patientName.length() < 1) { System.out.println("patient name is either too long or too short. Please enter a name between 1 to 15 characters."); } else if (emergencyLvl > 100 || emergencyLvl < 30) { System.out.println("Emergency level is either too high or too low. Please enter a valid level between 30 to 100."); } else { int i; for (i = 0; i < patientlist.size(); i++) { if (patientlist.get(i).getPatientName().compareToIgnoreCase(patientName) == 0) { System.out.println("Patient already admitted"); break; } } if (i == patientlist.size()) { patientlist p = new patientlist(patientName.toUpperCase(), emergencyLvl); patientlist.add(p); } } } void UpdateEmergencyLvl(String patientName, int incEmergencyLvl) { // You have to update the emergencyLvl of patientName to // emergencyLvl += incEmergencyLvl // and modify your chosen data structure (if needed) int i; for (i = 0; i < patientlist.size(); i++) { if (patientlist.get(i).getPatientName().compareToIgnoreCase(patientName) == 0) { //System.out.println("Patient already admitted"); //break; if (incEmergencyLvl > 70 || incEmergencyLvl < 0) { System.out.println("Emergency level is either too high or too low. Please enter a valid increment between 0 to 70.");
  • 3. break; } else { patientlist.get(i).setEmergencyLvl(patientlist.get(i).getEmergencyLvl() + incEmergencyLvl); } } } } void Treat(String patientName) { // This patientName is treated by the doctor // remove him/her from your chosen data structure int i; for (i = 0; i < patientlist.size(); i++) { if (patientlist.get(i).getPatientName().compareToIgnoreCase(patientName) == 0) { patientlist.remove(i); } } } String Query() { String ans = "The emergency room is empty"; int i; if(patientlist.isEmpty()) return ans; else{ int max=patientlist.get(0).getEmergencyLvl(); int pos=0; for (i = 1; i < patientlist.size(); i++) { if (patientlist.get(i).getEmergencyLvl()>max) { max=patientlist.get(i).getEmergencyLvl(); pos=i; } } return patientlist.get(pos).getPatientName(); } // You have to report the name of the patient that the doctor // has to give the most attention to currently. If there is no more patient to
  • 4. // be taken care of, return a String "The emergency room is empty" } void run() throws Exception { // do not alter this method BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); PrintWriter pr = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out))); int numCMD = Integer.parseInt(br.readLine()); // note that numCMD is >= N while (numCMD-- > 0) { StringTokenizer st = new StringTokenizer(br.readLine()); int command = Integer.parseInt(st.nextToken()); switch (command) { case 0: ArriveAtHospital(st.nextToken(), Integer.parseInt(st.nextToken())); break; case 1: UpdateEmergencyLvl(st.nextToken(), Integer.parseInt(st.nextToken())); break; case 2: Treat(st.nextToken()); break; case 3: pr.println(Query()); break; } } pr.close(); } public static void main(String[] args) throws Exception { // do not alter this method EmergencyRoom ps1 = new EmergencyRoom(); ps1.run(); } } Solution
  • 5. package s3; // Copy paste this Java Template and save it as "EmergencyRoom.java" import java.util.*; import java.io.*; // write your matric number here: // write your name here: // write list of collaborators here: // year 2016 hash code: XAbyuzR78fXeaMHBdLan (do NOT delete this line) class patientlist { private String PatientName; private int emergencyLvl; public patientlist(String PatientName, int emergencyLvl) { this.PatientName = PatientName; this.emergencyLvl = emergencyLvl; } public String getPatientName() { return PatientName; } public void setPatientName(String PatientName) { this.PatientName = PatientName; } public int getEmergencyLvl() { return emergencyLvl; } public void setEmergencyLvl(int emergencyLvl) { this.emergencyLvl = emergencyLvl; } } class EmergencyRoom { // if needed, declare a private data structure here that // is accessible to all methods in this class private List patientlist; public EmergencyRoom() { // Write necessary code during construction patientlist = new ArrayList(); }
  • 6. void ArriveAtHospital(String patientName, int emergencyLvl) { // You have to insert the information (patientName, emergencyLvl) // into your chosen data structure if (patientName.length() > 15 || patientName.length() < 1) { System.out.println("patient name is either too long or too short. Please enter a name between 1 to 15 characters."); } else if (emergencyLvl > 100 || emergencyLvl < 30) { System.out.println("Emergency level is either too high or too low. Please enter a valid level between 30 to 100."); } else { int i; for (i = 0; i < patientlist.size(); i++) { if (patientlist.get(i).getPatientName().compareToIgnoreCase(patientName) == 0) { System.out.println("Patient already admitted"); break; } } if (i == patientlist.size()) { patientlist p = new patientlist(patientName.toUpperCase(), emergencyLvl); patientlist.add(p); } } } void UpdateEmergencyLvl(String patientName, int incEmergencyLvl) { // You have to update the emergencyLvl of patientName to // emergencyLvl += incEmergencyLvl // and modify your chosen data structure (if needed) int i; for (i = 0; i < patientlist.size(); i++) { if (patientlist.get(i).getPatientName().compareToIgnoreCase(patientName) == 0) { //System.out.println("Patient already admitted"); //break; if (incEmergencyLvl > 70 || incEmergencyLvl < 0) { System.out.println("Emergency level is either too high or too low. Please enter a valid increment between 0 to 70."); break;
  • 7. } else { patientlist.get(i).setEmergencyLvl(patientlist.get(i).getEmergencyLvl() + incEmergencyLvl); } } } } void Treat(String patientName) { // This patientName is treated by the doctor // remove him/her from your chosen data structure int i; for (i = 0; i < patientlist.size(); i++) { if (patientlist.get(i).getPatientName().compareToIgnoreCase(patientName) == 0) { patientlist.remove(i); } } } String Query() { String ans = "The emergency room is empty"; int i; if(patientlist.isEmpty()) return ans; else{ int max=patientlist.get(0).getEmergencyLvl(); int pos=0; for (i = 1; i < patientlist.size(); i++) { if (patientlist.get(i).getEmergencyLvl()>max) { max=patientlist.get(i).getEmergencyLvl(); pos=i; } } return patientlist.get(pos).getPatientName(); } // You have to report the name of the patient that the doctor // has to give the most attention to currently. If there is no more patient to // be taken care of, return a String "The emergency room is empty"
  • 8. } void run() throws Exception { // do not alter this method BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); PrintWriter pr = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out))); int numCMD = Integer.parseInt(br.readLine()); // note that numCMD is >= N while (numCMD-- > 0) { StringTokenizer st = new StringTokenizer(br.readLine()); int command = Integer.parseInt(st.nextToken()); switch (command) { case 0: ArriveAtHospital(st.nextToken(), Integer.parseInt(st.nextToken())); break; case 1: UpdateEmergencyLvl(st.nextToken(), Integer.parseInt(st.nextToken())); break; case 2: Treat(st.nextToken()); break; case 3: pr.println(Query()); break; } } pr.close(); } public static void main(String[] args) throws Exception { // do not alter this method EmergencyRoom ps1 = new EmergencyRoom(); ps1.run(); } }