Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Answer this in c++ program use .cpp not .h Write a program to prioritize, and output to the screen, an array of medical emergenices at
Answer this in c++ program use .cpp not .h
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 arrayStep 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