Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In c++ please Write a program to prioritize, and output to the screen, an array of medical emergencies at a hospital. As individual emergencies arrive,

In c++ please image text in transcribed
Write a program to prioritize, and output to the screen, an array of medical emergencies at a hospital. As individual emergencies arrive, each is placed into the array with those of higher priority being put in front of others. Three levels of priority exist, specifically 1 (highest), 2 (medium) and 3 (lowest). When an emergency is inserted into the array, all those of lower priority must be moved back, using a function, to create a space for the higher priority emergency. For example, if the array contains, from front to back, the emergencies {2, 2, 3} and a priority 1 emergency arrives, then the array, after the insertion, would contain the emergencies {1, 2, 2, 3}. A second function is needed to print, from front to back, the current contents of the array. Your submission should include a screenshot of the execution of the program using the following sequence of operations, which can be directly coded into the program. Insert emergency (priority 2) print array insert emergency (priority 2) insert emergency (priority 1) print array insert emergency (priority 3) print array insert emergency (priority 2) insert emergency (priority 1) insert emergency (priority 1) print array insert emergency (priority 2) insert emergency (priority 3) print array

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

PostgreSQL Up And Running A Practical Guide To The Advanced Open Source Database

Authors: Regina Obe, Leo Hsu

3rd Edition

1491963417, 978-1491963418

More Books

Students also viewed these Databases questions

Question

^&* What is the purpose of using technical indicators?

Answered: 1 week ago

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago