ITSE 2445 - Data Structures and
ITSE 2445 Data Structures
Bob Comer, Professor of Computer Studies


Data Structures

General Program Requirements - Documentation and Style

1. The driver program for each programming project should begin with "header comments" containing:

For example:

// Programmer: Bob Comer
// Project Number: 1
// Project Desc: Quadratic Equations
// Course: Data Structures
// Date: Jan. 29, 2004

2. Use a standard indentation convention in your code (see examples in textbook).

3. Use meaningful variable names. Do not use global variables.

4. Each project should be divided into separate files: the class header file(s), the class implementation file(s), and the client (driver) program file. Your header filename should have an extension of ".h". The accompanying implementation filename should have the same name and an extension of ".cpp". See sections 4.2 and 4.3 in the Nyhoff textbook.

5. The class implementation file(s) and the client program file should be set up to compile separately. The example programs in the textbook that contain classes are all set up for separate compilation. But they do not show you how to set up the files in your compiler environment. Most C++ Integrated Development Environments will require that you set up a project for your program. If you are using Dev-C++ and are not familiar with setting up projects, see the "Multiple files" link on this page:

Becky Reichenau's Dev-C++ Page

6. Do not include code in your class header file. The definitions for the class member functions should be in the implementation file. See sections 4.2 and 4.3 in the Nyhoff textbook.

7. Your header file should include documentation (comments) to describe your class. Include preconditions and postconditions for each function. See description and example of a header file in sections 4.2 and 4.3 of the Nyhoff textbook.

8. The textbook tends to use if statements to test function preconditions. Important: Use assert statements (not if statements) in your functions to check the preconditions. You may alternatively use exceptions when preconditions are not met, but we will not cover exceptions in this class.

9. The driver program file should contain the main function and any accompanying functions. Include any needed compiler directives and the header file(s), but do not include the implementation file. See sections 4.2 and 4.3 in the Nyhoff textbook.

Only minimal documentation (comments) is needed for the implementation file and the driver program.

10. Program Test Data

Your program test data should not be hard-coded in your program. Your test data should be input from the keyboard or from an input file. This should make it easier to test your program.

11. Program Output

Deliverables