Question
C++ You are to generate a list of customers to serve based on the customers priority, ie create a priority queue/list for a local company.
C++
You are to generate a list of customers to serve based on the customers priority, ie create a priority queue/list for a local company. The company has been receiving request and the request are recorded in a file, in the order the request was made. The company processes each user based on their priority, the highest priority which is the largest number. Priorities of equal value are first come first served as listed in the input file. You input is a collection of customer IDs and priority, one pre line. You are to read in the data and insert new data into a sorted link list. The link list is sorted by priority.
A customer may need an update on his order. He may submit a request a second time in order to change his priority level. If so, you will search the link list, change the priority and adjust the new order in the sorted link list. ie, upon reading each ID and priority, you will search the link list first. If the ID is found, update the request. If not found, insert the new request into the link list.
Input file: Priority Queue.txt
Output: List of IDs with priorities in priority order
Example input: 1345 4
8243 1
Example output:
Customer Processing Order
Customer ID Priority
4124 5 1345 4
.
Restrictions: Use an ordered link list for the data structure and produce a nice formatted print out.
DATA: 1432 2 8234 3 2124 5 8123 2 1314 2 1432 4 7141 3 7878 1 7123 4 5523 1 6543 2 1731 5 3813 4 7213 5 3318 5 7213 3 7131 2 8882 3 9974 1 7221 3 5523 3 7342 4 9974 2 5523 3 3113 5 7002 4 9769 1 3145 5 7145 3 8834 2 7145 4 9123 4 7878 5 7588 4 2025 1 6069 3 2025 3
Step 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