Linked Lists and the
'Helpdesk' Application

Learning Objectives:(This is a list of the major topics that you, as
students, will learn in this
assignment:)

Linked Lists
In this assignment, you will need to implement a simple linked
list class (either a pure linked list class that is used by other
classes, or else you will merge an implementation of a linked list
class into another class). Specifically, you will need to be
able to add nodes to / remove nodes from the ends of the linked
list.

Abstract Data Type(s)
In this assignment, you will need to select and implement an
appropriate Abstract Data Type (although perhaps not a 'pure'
implementation of said ADT).

Part 1: Writing the program

Imagine that you're writing an application to
managed Helpdesk tickets  people call the Helpdesk, the person enters the
request into the computer, and the computer then helps distribute these tasks to
the I.T. support people, who then fix the problem(s). For this assignment,
assume that the first item to show up at the helpdesk is the first item to get
fixed, and only once that's fixed, will the helpdesk move on to the second item,
and then on to the third, etc. The only exception to this rule is that an
item may designated as high priority. Examples of high priority tasks
might include: the file server has crashed (crippling instruction in all
computer-related classes), and the President's
computer is no longer properly checking email. If there are multiple,
high-priority items, then the high priority items will be answered in the order
they were sent in (in the above example, the file server gets fixed, then the
President's computer, then any other high-priority tasks), and after the high
priority tasks are completed, then any low priority tasks will be completed
(also in the order that they were entered into the system).

You should base your program's design off one
of the Abstract Data Types that we've examined. Note that in order to support
the 'high priority' feature, you may need to deviate from a 'pure'
implementation of the ADT  this is expected, and fine. The ADT should be
implemented using a linked list, so that you get experience implementing linked
lists.

Each helpdesk ticket should
include a string that describes the problem, and another field that says whether
the problem is high priority or not. In order to help make sure that you
know how to manipulate object references, each node in your Linked List must
refer to a new instance of this Ticket object, rather than storing the
description & priority directly in the Node object. An example
implementation of the Ticket class is provided for you, if you want to use it.

Your program should allow someone
to view all the currently un-solved tickets, add a ticket (high-priority or
low-priority), and mark the next task (high-priority or low-priority) as being completed.

Starter Project: You will
be provided with a starter project that will provide you with two major
components:

A console-based user interface
that will use the code that will use the Helpdesk class that you implement in
order to provide the functionality described in the previous paragraph, and

A suite of unit tests that you
can use to verify that your implementation meets certain minimums of
functionality and correctness. Keep in mind that passing these tests does
not guarantee that your code will be properly implemented, or that it will
function properly in the provided Console application. But they may help
point you towards trouble spots in your code. Please also note that while
your code must pass all the tests for the Helpdesk class, you may or may not
choose to implement a separate List class, and so you may (or may not) make use
of the tests for the ListOfTickets class. If your Helpdesk class does make use of
a separate class to keep track of the actual Tickets, then that separate class
must also pass all the tests provided in the 'ListOfTickets_TEST' class.

Note that the provided code will
not compile as given - you will need to implement the Helpdesk class, and you
will need to implement the CHelpdesk class,
and adjust the unit tests (if provided) to test your code.

The interface to the Helpdesk
class is defined below, so that you're clear on how the Helpdesk class needs to
behave. You are free to create other classes ('helper classes', or
auxiliary classes) that you use to implement the Helpdesk class.

Helpdesk Data &
Methods

Data Field Name

Type

Description:

You're free to add any

data fields that you need to, in

order to accomplish the objectives set forth
in this assignment

Note:
all data fields should be marked private(if you need
to expose them, use Properties, or accessor/mutator methods)

Method Name

Returns

Description/Parameters:

<constructor>

Nothing, by definition

Any initialization that you need to do

isEmpty

bool

Parameters: None

Returns true if there are no tickets currently
being tracked by the Helpdesk object.

Returns false is there is at least one ticket
being tracked by the Helpdesk object.

AddTicket

void

If you know about
Exception Handling, and a substantial error occurs, you can throw an
Exception. You will also need to write the code that handles the
exception, as well.

Parameters:

string
desc: This is a text description of what the problem is

Priority
prio: This identifies the priority of the ticket (High or Low, implemented
using an enumeration)

This method will take the description of the problem, and create a
helpdesk ticket to track the problem.

RemoveNextTicket

Ticket

If you know about
Exception Handling, and a substantial error occurs, you can throw an
Exception. You will also need to write the code that handles the
exception, as well.

Parameters: None

This method will silently remove the 'first' task, assuming
that there is one. To be clear: each call to this method resolves
exactly one ticket.High priority tickets are resolved before Low priority
tickets.

For High priority tasks, those High priority tasks that
were added first will be resolved (removed) first ; once any and all High priority
tickets have been resolved, then the Low tasks will be resolved - the
Low tickets that were added first will be resolve first.

Returns
null if there are no tickets currently
being tracked by the Helpdesk object.

If there is at least one ticket being tracked by the
Helpdesk object, this will return a reference to the Ticket object that is
removed.

PrintAll

void

Parameters: None

If there are any Tickets, this method will print them all, in
the order that they will be resolved (i.e., the first Ticket that
RemoveNextTicket will remove will be printed first, followed by the 2nd
Ticket, etc, etc)

Note:
all methods should be marked public

Note:
All methods should run in a minimum amount of time, and with a minimum
amount of space (memory) consumed. Using Big 'Oh' notation, all
methods (except PrintAll) should run in O(1) time and space.

Group Work, Commenting:

You are
not allowed to work in groups for this assignment. You should start,
finish, and do all the work on your own. If you have questions, please contact
the instructor.

Additionally, you should aggressively comment your code, paying particular
attention to areas that are difficult to understand. If you found something to
be tricky when you wrote it, make sure to comment it so that the next person
(the instructor, who's grading you) understands what your code is doing. It is
not necessary to comment every single line.

The purpose of new requirement is to both
help you understand, and have you demonstrate, a thorough understanding of
exactly how your program works.

Every file
that you turn in should have:

·At the top of each file that
you normally edit, you should put your name (first and last), the name of this
class (BIT 142), and the year and quarter, and the assignment number,
including the revision number, which starts at 0 (A2.0). If youre handing
this in again for a regrade, make sure to increase the minor version number by
one (from A2.0, to A2.1").
You normally edit the C# source code files (.CS files), and any Word documents
that you're handing in (if any).
You do not normally edit the .SLN or .CSPROJ files, and so you should not try to
put this identifying information in those files.

In general, you
should make sure to do the following before handing in your project:

·All variables used should
have meaningful names.

·The code should be formatted
consistently, and in an easy to read format.

What to turn in:

·A single electronic folder
(a directory). This folder should contain:

oThe source code for the
program  all the .CS files in your project.
I would prefer that you include the project files  stuff ending in .SLN and
.VCPROJ, so I can build your project more easily. If you can save these files
(the .SLN / . VCPROJ) into a file format that can be opened by VS.Net 2003, that
would be great.

oYou have to name the folder
with your last name, then first name, then the assignment number (both the major
version  2, and the minor (revision) number  0). Example: "Panitz, Mike,
A2.0"

·You should not include
the Debug directory, or anything from it. I will dock you a couple points if
you do. Also, you don't need to include your .NCB file, if it's present.

How to
electronically submit your homework:

There's a link on the
homework page to the document that guides you through handing in your work,
using the SourceGear Vault program.

This document and the related materials are developed with support
from Microsoft Research Computer Gaming Initiative under the Computer Gaming
Curriculum in Computer Science RFP, Award Number 15871.