Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write as a C++ programme language Thank you! Write a program to prioritize, and output to the screen, an array of medical emergenices at a

Write as a C++ programme language

Thank you!

image text in transcribed

Write a program to prioritize, and output to the screen, an array of medical emergenices at a hospital. As individual emergenices 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

More Books

Students also viewed these Databases questions

Question

what is a peer Group? Importance?

Answered: 1 week ago