Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can it be written in c++ please. Question Using heaps and priority queuing, design and implement an emergency room simulator. The purpose of the simulator
Can it be written in c++ please.
Question Using heaps and priority queuing, design and implement an emergency room simulator. The purpose of the simulator is to model the daily flow of patients through an emergency room. The system must be able to store the patient's name and complaint and then be able to prioritize their access based on the severity of their complaint and the order they entered the ER. A priority queue implemented with a heap won't preserve the order in which patients are entered into the simulator; we will need to store additional data to indicate when the patient arrived in relation to the other patients in the ER. The system should support two modes: a build mode and a run mode. The system starts in build mode. The build mode allows the user to populate the emergency room with any number of patients prior to entering run mode. Build mode should support the following commands: 1. Add prompts the user to add a new patient and health complaint. The priority queue hasn't been built yet, so patients added during build mode should be added directly to the end of the patient list. 2. Run- switch to run mode. Switching to run mode turns the list of patients into a priority queue. 3. Exit- exit the program The run mode allows the user to interact with the priority queue. Run mode should support the following commands: 1. Add-prompts the user to add a new patient and health complaint into the priority queue. 2. Next-displays the next patient to be seen in the ER and updates the priority queue. 3. Peek-displays the next patient to be seen in the ER without removing them from the priority queue. 4. Build-switch to build mode 5. Exit exit the program tes (partial list, other attributes might be n Data Type String String Integer Purpose Name of patient Patient's Complaint Priority value for complaint Unique number representing when the patient arrived Name Priority (partial list, other methods might be Return Type Parameter List Purpose None Name Constructor None Empty constructor that creates a basic patient with an ambulatory level complaint and a ticket of-1 Constructor None Name: String Constructor that creates a patient with Complaint: String name, complaint, priorty, and ticket set Priority: Integer to the specified values Ticket: Integer (partial list, other attributes might be necessary) Name heap mode next ticket Integer Data Type Purpose List of patients, complaints, and priority levels Run mode = true, Build mode = false The next ticket number to be assigned to a patient (partial list, other methods might be necessary) Roturn TunaStep 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