Sei sulla pagina 1di 2

COMP2115: Information Structures

Programming Assignment Project


Semester I, 2010-2011

(Due on Thursday 25 November, 2010 - No Later Than 4:00 PM.

ABSOLUTELY No late assignments will be accepted!

Project Objective:
You are required to use wxWidgets to develop a Graphical User Interface (GUI) with some of
the abstract data types as the menu items and the member functions as sub-menu items.

Requirements:
For this programming assignment you are required to:
1. Read data from a Random Access File to populate an AVL Tree, a Priority Queue
and a Binary Heap abstract data types with the data from the file.
2. Perform some of the functions associated with the particular ADTs.
3. Save the results displayed by the functions to a text file.

Your program should be created using wxWidgets in Linux OpenSuse.

The data for your assignment is provided in the accompanying random access file
“GuestsData.dat”. However, the file should not be hard-coded into your program. Each record
has data in the form of: Guest ID number (long integer), first name (15 characters), surname (15
characters), payment method (characters), Number of days at the hotel (integer), room type (10
characters), room number (integer) and purpose of stay (10 characters). The key field is the
Guest ID number.

You are required to read the file and place the records on the AVL Tree, the Binary Heap and the
Priority Queue. It should be noted that the smaller a guest’s ID number is, the higher its priority.

Method:
Develop a GUI with menu items of File, Display File, BST, AVL Tree, Priority Queue, Heap,
Exit and About. Those ADTs should have sub-menus as follows:
BST (Inorder, Preorder, Postorder),
AVL Tree (Inorder, Preorder, Postorder),
Priority Queue (Show Head, Show Tail, Display All, Dequeue),
Heap (Show All, Delete value, Heap Sort).

The code for the BST will be provided to you, but you will be responsible for attaching it to your
program. The output results of all the menu functions should be displayed in a text box within
your GUI. When the file is opened, the data should be immediately displayed in that textbox as
well as when the menu option for Display File is clicked.

The File menu item has the sub-menus of Open File, Save File, Save As and Exit. When Open
File is clicked, the system fileOpen dialog should be opened with the option to display files of
type: Data (*.dat), Text (*.txt) and All (*.*). The user must also be able to type in the file name
in the textbox. Once the contents of a file are displayed or the result of some processing is
displayed, the menu selections of Save File and Save As should open the corresponding dialogs
to perform the desired task. Save As should allow the user to specify a file name and file type
into which the contents can be saved.

When the Display File menu item is clicked, the entire content of all the records in the binary
file should be displayed in the display textbox.

Note that before each display operation is carried out, the display textbox should be cleared.
The menu items for the ADTs are self-explanatory. The operation indicated by the menu item
should then be carried out on that particular ADT ONLY. The other ADTs should NOT be
affected.

The Exit menu item is to close the program

The About menu item should produce a dialog box with suitable information about the
programmer and the program.

Finally, the GUI should be captioned: “COMP2115 – Information Structures Programming


Assignment - XXXXXXXXX”, where XXXXXXXXX is your student ID Number.

Hand in:

A virus-free soft copy of your project files and the Linux-compiled executable file in a
well-marked self-addressed envelope.

NOTE:

1. A bonus of 10% of the mark will be awarded to students who submit their
assignment on a rewritable DVD.

2. Kindly verify that ALL your files are actually written on the disc and your disc is
readable BEFORE submitting the assignment. You shall not be asked to re-submit
assignments if your disc is discovered to be blank or unreadable.

3. This assignment will contribute 15% to your course work mark.

DUE DATE : Thursday 25 November, 2010 - No Later Than 4:00 PM.

No late assignments will be accepted!

Potrebbero piacerti anche