Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help Write a program to prioritize, and output to the screen, an array of medical emergencies at a hospital. As individual emergencies arrive, each

Please help 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) 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 2) 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

Hands On Database

Authors: Steve Conger

1st Edition

013610827X, 978-0136108276

More Books

Students also viewed these Databases questions

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago