Project 4


The project documents will be added to this page as they become available. If you get a page that says "not yet available," it should become available in the future. Ask about it only if we announced that it was supposed to be available.

Note:Files listed as "pdf" can be viewed or downloaded and printed at high-quality with Adobe's Acrobat Reader.

Files listed as text are plain ASCII text files. The should display in your browser with correct formatting, but can also be downloaded from the course file server; downloading with an ftp utility set to ASCII text mode is recommended for code files to avoid line-ending problems.


Component Specification Files

The link below connects to a "starters" subdirectory in the project4 directory. You need all of the .h and .cpp files in the starters directory. Some are complete header/source pairs for you to use as-is. Files with "skeleton" at the beginning of their names are incomplete files that you must add to, following the instructions in the comments.

The "strings.txt" file is a text file containing the character string constants that were used in the instructor's solution to generate the output message text. You can avoid typing errors by downloading this file and then copy-pasting these into your program.

The starters directory

Behavior Samples

The following sample behavior files illustrate the program behavior and contain all of the different output message text strings produced by the program (see the strings.txt file). The "_console.txt" files are a capture of the console display during the program run. The "_in.txt" and "_out.txt" files are for you to use with redirected I/O.

The "noshow" versions are the same sequence of inputs, but without the "show" commands. You can these to check your program before you implement the View.

Your program should match these samples exactly so that you can be sure it is producing all of the different kinds of messages correctly. However, these samples are not a complete test of your program. Your program will be tested for a large number of other possible inputs and input sequences.

The following sample illustrates the states and update behavior when two Soldiers attack a single Peasant, showing how one of the Soldiers reports being in the state of attacking a dead target.

The following samples shows the checking and error reporting involved with creating new objects with valid names.

The following sample illustrates the behavior of the program when two Soldiers fight, and contains a variety of messages, both normal and error messages.

The following sample illustrates the behavior of the program when two Peasants cooperate to move food to a far-off Town_Hall. Unfortunately, a Soldier interrupts the work. Afterwards, a new Structure and Agent are created. This contains a variety of messages, both normal and error messages.

The following sample illustrates the behavior of the program just with regard to the View, and contains a variety of messages, both normal and error messages.

These samples demonstrate the program behavior and are supposed to contain every possible type of output message. They are not a complete test of your program. Your program will be tested for a large number of other possible inputs and input sequences. The console interaction files are a capture of the console display during the program run. The _in.txt and _out.txt files are for you to use with redirected I/O. When given the _in.txt file, your program's stdout output should match the _out.txt file exactly.