CSC 120: C++ Provided Code for Lab 2


The following files are being provided:
makefile --- this is the makefile for compiling and linking this lab

If you have problems running the executable on husun3 add the line

setenv LD_LIBRARY_PATH /usr/local/lib:

in your .cshrc file. After you save the file, logout and then login again. inventory.cpp --- the portion of the driver provided is here

stdinc.h --- includes needed libraries and defines some const vars

input.h --- header file for the class Input used in user interface (for processing user input)

input.cpp --- code for the class Input

basic-data-record.h --- header file for the DataRec class

basic-data-record.cpp --- code for DataRec class

dictionary-record.h --- header file for the DictRec class

dictionary-record.cpp --- code for the DictRec class

dictionary.h --- header for the CSC120Dictionary class. You will fill in the private portion of the class definition (including data members and private member function, if you write any).

dictionary.cpp --- shell for the CSC120Dictionary class implementation. You must write the implementations of the methods (public), and one you define here. The hash function that is provided for you is in this file.

hash-test --- test data for the program. The file format is as follows: Each line starts with the number representing a choice from the menu (0 means no prompts, initially you should select 1). If a line starts with 1, i.e. add was selected from the menu, the data for the dictionary record follow (bar code, price, quantity, name).

hash-test-part2 --- test data for the last part of the program (testing save and load methods). The file format is same as for hash-test: Each line starts with the number representing a choice from the menu (0 means no prompts, initially you should select 1). If a line starts with 1, i.e. add was selected from the menu, the data for the dictionary record follow (bar code, price, quantity, name).
As described in the lab, first you run your program on hash-test. Next time run on hash-test-part2 (i.e. the first time you read the data file, and save the hash table; the second time you do not read the data file, you load the hash table using load method, make the changes/operations as specified by hash-test-part2, and at the end save the has table using the save method).


Return to the CSC 120 Home Page