Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help writing this program in C++ for a priority queue for a mock emergency room I need code for main.cpp as well as

I need help writing this program in C++ for a priority queue for a mock emergency room

I need code for main.cpp as well as a .h file

please use simple c++ so that I can learn how the program works

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Objectives: To strengthen student's knowledge of heaps and priority queuing To give student experience in writing Object Oriented code Background: Queuing is a problem which is commonly encountered in stores, movie theaters, IT services, and hospitals; many people or problems waiting in line to be addressed in an orderly and controlled fashion. Basic queues address the problem based solely on the relative positions of the object in the queue; the first object in the queue is the first object out of the queue. Basic queues are well suited to model simple lines like the ones found in stores, the DMV, and movie theaters. When other parameters such as degree of urgency impact the order in which the objects in the queue must be addressed, priority queuing is the answer. Priority queues pull objects from the queue based on measure of precedence known as priority. IT services and emergency rooms in hospital rooms often employ forms of priority queuing. Heaps are commonly used to implement a priority queues. The reason is because all elements in the heap are organized relative to a given heap order property. This property requires that items retrieved from the heap are either the smallest value in the heap (called a min heap), or the largest value in the heap (called a max heap). In other words, when retrieving data from a min heap, the element with the smallest value over all elements in the heap has priority and is removed first; the same holds for a max heap. The heap data structure is a complete binary tree, implemented as a static or dynamic array, where each subtree in the tree also follow the heap order property (i.e. the root is either the minimal or maximal value in that subtree). This exercise will focus on the potential use of priority queuing in emergency rooms. Hospital emergency rooms often divide the severity of their cases into five general levels from most urgent to least urgent: Code, Critical, Urgent, Non-urgent disabled, Ambulatory. The Code level "refers to someone who has suffered cardiac arrest outside of the hospital or someone whose vital signs crash within the emergency department It also refers to" people with gunshot or stab wounds with possible vital organ involvement and/or altered or absent vital signs [1]." Patients at the Code level bypass the management system and are taken directly to the next available trauma bed. The Critical level refers to "a person with stable vital signs who is exhibiting symptoms or who gives a history that clearly delineates a life-threatening condition. This might be a patient with chest pain, shortness of breath, and profuse sweating (diaphoresis). This also would include people who have a history of vomiting blood, multiple traumas with head injury, or a gunshot or stab wound, as well as asthmatics, diabetics with low blood sugar or extremely high blood sugar, and the like. [1 The Urgent level refers to "patients with serious conditions requiring medical intervention within two hours ...These are people with abdominal pain, high fever and/or productive cough, deep lacerations with bleeding under control, closed fractures with deformity, and so on [ Objectives: To strengthen student's knowledge of heaps and priority queuing To give student experience in writing Object Oriented code Background: Queuing is a problem which is commonly encountered in stores, movie theaters, IT services, and hospitals; many people or problems waiting in line to be addressed in an orderly and controlled fashion. Basic queues address the problem based solely on the relative positions of the object in the queue; the first object in the queue is the first object out of the queue. Basic queues are well suited to model simple lines like the ones found in stores, the DMV, and movie theaters. When other parameters such as degree of urgency impact the order in which the objects in the queue must be addressed, priority queuing is the answer. Priority queues pull objects from the queue based on measure of precedence known as priority. IT services and emergency rooms in hospital rooms often employ forms of priority queuing. Heaps are commonly used to implement a priority queues. The reason is because all elements in the heap are organized relative to a given heap order property. This property requires that items retrieved from the heap are either the smallest value in the heap (called a min heap), or the largest value in the heap (called a max heap). In other words, when retrieving data from a min heap, the element with the smallest value over all elements in the heap has priority and is removed first; the same holds for a max heap. The heap data structure is a complete binary tree, implemented as a static or dynamic array, where each subtree in the tree also follow the heap order property (i.e. the root is either the minimal or maximal value in that subtree). This exercise will focus on the potential use of priority queuing in emergency rooms. Hospital emergency rooms often divide the severity of their cases into five general levels from most urgent to least urgent: Code, Critical, Urgent, Non-urgent disabled, Ambulatory. The Code level "refers to someone who has suffered cardiac arrest outside of the hospital or someone whose vital signs crash within the emergency department It also refers to" people with gunshot or stab wounds with possible vital organ involvement and/or altered or absent vital signs [1]." Patients at the Code level bypass the management system and are taken directly to the next available trauma bed. The Critical level refers to "a person with stable vital signs who is exhibiting symptoms or who gives a history that clearly delineates a life-threatening condition. This might be a patient with chest pain, shortness of breath, and profuse sweating (diaphoresis). This also would include people who have a history of vomiting blood, multiple traumas with head injury, or a gunshot or stab wound, as well as asthmatics, diabetics with low blood sugar or extremely high blood sugar, and the like. [1 The Urgent level refers to "patients with serious conditions requiring medical intervention within two hours ...These are people with abdominal pain, high fever and/or productive cough, deep lacerations with bleeding under control, closed fractures with deformity, and so on [

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visualizing Health And Healthcare Data Creating Clear And Compelling Visualizations To See How Youre Doing

Authors: Katherine Rowell ,Lindsay Betzendahl ,Cambria Brown

1st Edition

1119680883, 978-1119680888

More Books

Students also viewed these Databases questions

Question

How did you feel about taking piano lessons as a child? (general)

Answered: 1 week ago