Project 2
Due : 11:59pm, 22 July
Write a simulation of a window list manager in a typical GUI.
Window lists in GUIs are handled quite often by creating a data
structure associated with each window, and storing these in a circular
doubly linked list.
Create a simulation of this process where the sole data item associated
with each window is the title of the window, stored as a string.
The window list is a circular doubly linked list with the following
methods (and constructor/destructor) :
- AddWindow - Add a new window to the current top of the window
list, where "top" is defined as that window pointed to by the pointer Head
- DeleteWindow - Delete the window pointed to by Head and make
the next window the top window in the list. If the window list is empty,
do nothing.
- Traverse - Visit each window in the list exactly once and call
the function Visit for each window. The strange parameter being passed is
a pointer to a function - check the given main program for how this is
used. Within the function itself, you would call this function by its
parameter name (eg Visit (Head))
- NextWindow - Cycle the windows so that the next window is moved
to the top of the list - in practice, just move the Head pointer to the
next node
- PrevWindow - Cycle the windows in the opposite direction so
that the previous window is moved to the top of the list
Source code for the Window class and all header files are provided and
must be adhered to rigidly. Also, a main program is provided for testing
purposes, with the output that is expected.
Requirements (Contents of submission)
- Write the module WINDOWL.CPP (or .CC or .C++) that is the
implementation of the WindowList class
- Write a main program to provide the user with an interactive interface
to test the program
- Create the appropriate Makefile or DSP/DSW files
- Test the program thoroughly and provide evidence (in the form of
screen dumps and/or redirected output) that the program works correctly
under a large variety of input combinations. Use these to create a report
in the form of a single TXT or Microsoft Word DOC file that details all
the tests performed and the results obtained. The graders must be able to
ascertain that your program works simply by reading through the report.
Embed actual images and actual output in the report file as necessary.
- Internally document all source files that you have created
- Include the given WINDOW.H, WINDOW.CPP and WINDOWL.H files in your
submission
IMPORTANT: Your WINDOWL.CPP module will be linked with our test
program so it must adhere STRICTLY to the interface and specifications of
each method. Do not make any changes to WINDOW.H, WINDOW.CPP or WINDOWL.H.
Files
- window.h
- window.cpp
- windowl.h
- main.cpp
- output
Last updated : 2 August 1999 4:35pm