a) Priority Queue In a hospital, as patients enter, the front desk records their name and assign them a priority number. These values will be inserted in a priority queue (a higher number indicates a higher priority). Once you get information from several patients and enter it into a priority queue, display this queue from the highest priority patient to the lowest priority patient. (As shown in the sample output). Sometimes a nurse may discover that a patient was given the wrong priority number and will want to modify this value. Write a function that will allow a nurse to search for a specific patient and change his/her priority number. Once you make these changes, display the queue again from the highest priority patient to the lowest priority patent. (See the sample output). (Hint: use of library functions from string.h header file will help when handling strings). You may want to come up with at least 3 separate functions: insert, display, and search Microsoft Visual Studio Debug Console Enter 1 to add a new patient, 2 to change the priority, 3 to display the queue, Any other key to quit: 1 Enter patient's first name: Oliver Enter patient's priority #: 5 Enter 1 to add a new patient, 2 to change the priority, 3 to display the queue, Any other key to quit: 1 Enter patient's first name: Emma Enter patient's priority #: 2 Enter 1 to add a new patient, 2 to change the priority, 3 to display the queue, Any other key to quit: 1 Enter patient's first name: Amelia Enter patient's priority #: 8 Enter 1 to add a new patient, 2 to change the priority, 3 to display the queue, Any other key to quit: 1 Enter patient's first name: James Enter patient's priority #: 9 Enter 1 to add a new patient, 2 to change the priority, 3 to display the queue, Any other key to quit: 3 Priority Queue is: James Pri:9| |Amelia Pri:8 |Oliver Pri:5| |Emma Pri:2| x

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
a) Priority Queue
In a hospital, as patients enter, the front desk records their name and assign them a
priority number. These values will be inserted in a priority queue (a higher number
indicates a higher priority). Once you get information from several patients and enter it
into a priority queue, display this queue from the highest priority patient to the lowest
priority patient. (As shown in the sample output).
Sometimes a nurse may discover that a patient was given the wrong priority number
and will want to modify this value. Write a function that will allow a nurse to search for a
specific patient and change his/her priority number. Once you make these changes,
display the queue again from the highest priority patient to the lowest priority patent.
(See the sample output).
(Hint: use of library functions from string.h header file will help when handling strings).
You may want to come up with at least 3 separate functions: insert, display, and search.
Microsoft Visual Studio Debug Console
Enter 1 to add a new patient, 2 to change the priority,
3 to display the queue, Any other key to quit: 1
Enter patient's first name: Oliver
Enter patient's priority #: 5
Enter 1 to add a new patient, 2 to change the priority,
3 to display the queue, Any other key to quit: 1
Enter patient's first name: Emma
Enter patient's priority #: 2
Enter 1 to add a new patient, 2 to change the priority,
3 to display the queue, Any other key to quit: 1
Enter patient's first name: Amelia
Enter patient's priority #: 8
Enter 1 to add a new patient, 2 to change the priority,
3 to display the queue, Any other key to quit: 1
Enter patient's first name: James
Enter patient's priority #: 9
Enter 1 to add a new patient, 2 to change the priority,
3 to display the queue, Any other key to quit: 3
Priority Queue is: James Pri:9| |Amelia Pri:8| |Oliver Pri:5| |Emma Pri:2|
Enter 1 to add a new patient, 2 to change the priority,
3 to display the queue, Any other key to quit: 2
Enter the first name of the patient: Oliver
Enter the new priority: 1
Enter 1 to add a new patient, 2 to change the priority,
3 to display the queue, Any other key to quit: 3
Priority Queue is: James Pri:9| |Amelia Pri:8| |Emma Pri:2| |Oliver Pri:1|
Enter 1 to add a new patient, 2 to change the priority,
A
Transcribed Image Text:a) Priority Queue In a hospital, as patients enter, the front desk records their name and assign them a priority number. These values will be inserted in a priority queue (a higher number indicates a higher priority). Once you get information from several patients and enter it into a priority queue, display this queue from the highest priority patient to the lowest priority patient. (As shown in the sample output). Sometimes a nurse may discover that a patient was given the wrong priority number and will want to modify this value. Write a function that will allow a nurse to search for a specific patient and change his/her priority number. Once you make these changes, display the queue again from the highest priority patient to the lowest priority patent. (See the sample output). (Hint: use of library functions from string.h header file will help when handling strings). You may want to come up with at least 3 separate functions: insert, display, and search. Microsoft Visual Studio Debug Console Enter 1 to add a new patient, 2 to change the priority, 3 to display the queue, Any other key to quit: 1 Enter patient's first name: Oliver Enter patient's priority #: 5 Enter 1 to add a new patient, 2 to change the priority, 3 to display the queue, Any other key to quit: 1 Enter patient's first name: Emma Enter patient's priority #: 2 Enter 1 to add a new patient, 2 to change the priority, 3 to display the queue, Any other key to quit: 1 Enter patient's first name: Amelia Enter patient's priority #: 8 Enter 1 to add a new patient, 2 to change the priority, 3 to display the queue, Any other key to quit: 1 Enter patient's first name: James Enter patient's priority #: 9 Enter 1 to add a new patient, 2 to change the priority, 3 to display the queue, Any other key to quit: 3 Priority Queue is: James Pri:9| |Amelia Pri:8| |Oliver Pri:5| |Emma Pri:2| Enter 1 to add a new patient, 2 to change the priority, 3 to display the queue, Any other key to quit: 2 Enter the first name of the patient: Oliver Enter the new priority: 1 Enter 1 to add a new patient, 2 to change the priority, 3 to display the queue, Any other key to quit: 3 Priority Queue is: James Pri:9| |Amelia Pri:8| |Emma Pri:2| |Oliver Pri:1| Enter 1 to add a new patient, 2 to change the priority, A
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 3 images

Blurred answer
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY