our task for this assignment is to develop a print scheduling application. The application will use an array-based heap to implement a priority queue data structure in C++. This will be accomplished utilizing a user-defined Heap class. 1. Implement a transaction-based priority queue data structure using C++. The program will be interactive. A prompt will be displayed requesting an input transaction. Each input transaction will be entered at the command line and results will be displayed on the console. 2. Each input transaction will represent either (1) a new print request transaction or (2) a “service” transaction. A new print request transaction will be represented in two parts separated by a hyphen: customer name (variable length) and print file size in pages (positive integer). Each new print request is issued a sequential 2-digit ticket number (00 through 99). Each print request is scheduled based on priority and ticket. A small size request (i.e., less than 4 pages) is assigned priority 1 (highest). A medium size request (4 to 10 pages) is assigned priority 2. A large size request (more than 10 pages) is assigned a priority 3 (lowest). Each print request is placed in a priority queue and will be serviced by the next available printer. A “service” transaction results in a print request being removed from the priority queue and the customer name being displayed on the console. A transaction containing the string “end-of-file” will signal the end of the input. Your program will display the number of print requests remaining in the queue when the “end-of-file” transaction is processed. Sample input transactions and output expected using a priority queue: guo-4 hannie-1 ian-20 service (output: hannie) service (output: guo) danny-2 eli-17 fan-3 service (output: danny) service (output: fan) end-of-file (output: There are 2 remaining print requests in the queue.) 3. The program will be run at the command prompt by navigating to the directory containing the executable version of the program after the program is compiled. Assume that each transaction is prepared properly. Use an array with a capacity for 10 print requests. Display “Error: queue is empty” and “Error: queue is full” messages as needed.
PLEASE MAKE SURE ITS UNIQUE
Your task for this assignment is to develop a print scheduling application. The application will use an array-based heap to implement a priority queue data structure in C++. This will be accomplished utilizing a user-defined Heap class.
1. Implement a transaction-based priority queue data structure using C++. The program will be interactive. A prompt will be displayed requesting an input transaction. Each input transaction will be entered at the command line and results will be displayed on the console.
2. Each input transaction will represent either (1) a new print request transaction or (2) a “service” transaction. A new print request transaction will be represented in two parts separated by a hyphen: customer name (variable length) and print file size in pages (positive integer). Each new print request is issued a sequential 2-digit ticket number (00 through 99). Each print request is scheduled based on priority and ticket. A small size request (i.e., less than 4 pages) is assigned priority 1 (highest). A medium size request (4 to 10 pages) is assigned priority 2. A large size request (more than 10 pages) is assigned a priority 3 (lowest). Each print request is placed in a priority queue and will be serviced by the next available printer.
A “service” transaction results in a print request being removed from the priority queue and the customer name being displayed on the console. A transaction containing the string “end-of-file” will signal the end of the input. Your program will display the number of print requests remaining in the queue when the “end-of-file” transaction is processed.
Sample input transactions and output expected using a priority queue:
guo-4
hannie-1
ian-20
service (output: hannie)
service (output: guo)
danny-2
eli-17
fan-3
service (output: danny)
service (output: fan)
end-of-file (output: There are 2 remaining print requests in the queue.)
3. The program will be run at the command prompt by navigating to the directory containing the executable version of the program after the program is compiled. Assume that each transaction is prepared properly. Use an array with a capacity for 10 print requests. Display “Error: queue is empty” and “Error: queue is full” messages as needed.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps