Style Guide for CIS 22B assignments

Style for all assignments

Additonal styles beginning with Assignment D follow this section

Provide a heading comment at the beginning:

your first name followed by your last name as registered such as: Tommy Atkins
If you are working as a pair with another student, put both names on the same line seperated by the word: and
quarter such as: Spring 1984
Assignment letter such as: Assignment A
Problem number such as: Problem A1
Description of problem:
a few lines describing input, activity, and output of the program

Each function should have a function header similar to this example:

/* ******************** getSize ********************
asks user for size
size saved in calling function via reference parameter

Indent and align the braces and code following a select or repetition statement similar to this example:

for (int i=0; i<SIZE; i++)
  cout << array(i) << endl;

You will be writing a lot of code, so the following things are needed to be able to find the functions.

Save the execution results

When you have tested your results several times successfully, run your program with the test data specified by the instructor, to get the final result.
In the execution results window:

In your program, in the Execution results comment at the end of the program:

/* Execution results
right click here - paste

Print the program to turn in

Do not print until you are satisfied the program is correct, and the final results are included with the data specified by the instructor.

If you are using Code::Blocks, the paper size is probably A size rather than letter size. Printing to A size will not print all the lines, but instead loses some at the bottom of the page. To get around this problem, select all the program in Code::Blocks and copy it. Then paste it into notepad and print that.

Additional styles beginning with Assignment D

The global functions (except main) be located following the following heading:

global functions

When member functions are declared within the class, but defined later, group the code for these functions following a heading similar to the following example:

Car class functions

These member function definitions should each have a heading similar to the following example:

/* ******************** Car::setUp ********************
sets the values in the object