Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Priority Queue Problem: (Do not use preset library functions to create a priority queue) I am having trouble initializing a priority queue in my

C++ Priority Queue Problem: (Do not use preset library functions to create a priority queue)

I am having trouble initializing a priority queue in my driver program. The program will read a number from the command line that sets the max queue size.

Ex. int maxQueueSize = atoi(argv[2])

image text in transcribed

EXAMPLE TEXT FILE TO READ:

image text in transcribed

The first part of the program I need help writting is:

image text in transcribed

The menu looks like this:

image text in transcribed

The Header file is:

image text in transcribedimage text in transcribedimage text in transcribed

The output of the first menu option should be:

image text in transcribed

I don't need all of the methods from the header file completed. I just need the ones that are necessary to complete the "Get patient Information task."

Hospital Emergency Room Waiting List A hospital emergency room does not see patients on a first-come first-served (FIFO) basis. Rather, the most urgent patients are seen betore patients whose injuries are less severe or non-life-threatening. You will implement a priority queue such that patients with the most severe injuries are treated before those who can wait. You will also track the total time that the ER doctors have spent treating patients. For each patient in the priority queue, the following information is stored - Name - Injury Severity (an integer, higher values represent higher priorities for treatment) - Treatment Time (time in minutes required to provide treatment) cific ns Examples of the output formatting are shown in a later section of this document. Your priority queue will be implemented in a class based on the provided PriorityQueue.hpp. . You will also implement a driver program with menu functionality . Your program will read in the maximum queue size from the first command line argument. When attempting to add a new patient, if the priority queue is full, those patient s) will be sent to another hospital. Your program will give users the option to read patient information from a text file. This text file could represent a list of those injured in a major incident, such as a fire or other calamity, and are being transported by ambulance. The text file will have a header line, followed by patient information. Patient information will be stored one patient per line. There is no maximum number of patients that may be stored in the text file. Note that patient names will not have spaces. Information on each line will consist of name, followed by injury severity, followed by treatment time in minutes

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

Visual Basic6 Database Programming

Authors: John W. Fronckowiak, David J. Helda

1st Edition

ISBN: 0764532545, 978-0764532542

More Books

Students also viewed these Databases questions

Question

Question How are IRAs treated for state tax law purposes?

Answered: 1 week ago