Friday, June 22, 2018

Using C++ to: Handling Priorities with Linked Lists: Design a class called supportTicket that handles information about reported IT support issues. A ticket includes an id number, the location of the equipment (e.g., building and room number), a short description of the issue, and a priority level. A valid priority level is a value from 1-5. Tickets are services based on their priority level, from highest to lowest. More than one ticket may have the same priority level. However, when entering an item into the list that has the same priority as another item, the newest item should come after any previously entered items with the same priority. When a ticket is serviced, it is removed from the list. Implement a menu system that allows the program user to add a support ticket, service a ticket (remove it from list), and list active tickets in order of priority.

You have some decisions to make: the class that holds the individual support ticket and the implementation of the linked list, set, multiset, or array that holds all of them. Your assignment states that you need to use a linked list.
The individual support ticket should include the id, which should be a numeric data type. I'd choose integer or short, or even char, depending on how many open items you expect to have. It's probably not worth it to make it a short or char, which would save space; even if you know that would be adequate, I'd make it autoincrement. Otherwise you'll need to keep the number of the last id you added and increment by hand. Building and room number should be short, or even a char, since you can be sure you know the limit on the number of buildings and the number of rooms in each. An adequate type for the description is probably varchar (256).
Your list can be either singly or doubly linked. You'll need to keep a pointer to the head of the list, which will be null when the list is empty. It needs to be static, in order to be preserved across invocations of routine to add items to the list.
I'd make the list singly linked but keep a pointer to the previous item as you traverse the list. Once you have the first item, for each subsequent item you need to traverse the list either until you reach the end, in which case you add the item and point the last item to it, or until you find an item with a lower priority level, in which case you insert your new item between it and the previous one.
I'm not going to write your code for you, nor am I going to implement the menu handling, but this should help you get started.
Here are a couple of sites with documentation:
http://www.cplusplus.com/doc/

https://docs.microsoft.com/en-us/cpp/?view=vs-2019

https://en.cppreference.com/w/

No comments:

Post a Comment

What is the theme of the chapter Lead?

Primo Levi's complex probing of the Holocaust, including his survival of Auschwitz and pre- and post-war life, is organized around indiv...