IUP Computer Science
CO 310 Spring 1993
Assignment #2
(Due 24 Feb 1993)
The file P:PROJECT1.PAS contains the Pascal source code for
my solution for Project 1c, but without any comments. For
Project 2, you must do the following tasks.
1. Download the P:PROJECT1.PAS file to your diskette.
2. Using Turbo Pascal:
a. Convert the program so that it executes in the Turbo
environment. Very few changes should be needed to do
this. The student database file, on the network in the
Tompkins Lab, is L:\310\STU93.DAT. You may have your
program read this file or you may download your copy of
the file on the VAX and have the program read it.
b. Then, modify the program so that it is based on a linked
list instead of an array. That is, instead of holding
the records in an array, hold them in a linked list.
Change the ADD, DELETE, LIST, FIND, and RANK procedures
so that they work on the database linked list in the same
manner as they did on the array. Note: For the RANK
procedure, there are two reasonable approaches. You may
create an auxiliary linked list of pointer nodes to
replace the INDICES array and rearrange the auxiliary
linked list as the array was rearranged in my program.
Alternatively, you may continue to use the INDICES array;
however, it must become an array of pointers to nodes in
the database linked list, rather than an array of
integers (subscript numbers).
c. Add comments to the program so that it meets the requirements in the documentation handout.
You may implement the linked lists with or without header
nodes. You may use linear or circular lists.
Hand in a printout of the modified program. Turbo Pascal
does not generate compilation listings so you will need to use
the Turbo or DOS print command to make the printout. Also, hand
in a printout that demonstrates that the program works - use the
sequence of commands from Project 1b with an R command at the
beginning and at the end. The best way to capture this output is
to redirect the execution output to a file and then print the
file. Compile to disk and execute the program with redirection.
An alternative is to use Ctrl-PrintScreen to capture the output
as it executes and send it to the printer. This method is more
prone to error. DO NOT USE CTRL-PRINTSCREEN WHILE IN THE TURBO
ENVIRONMENT.