Assignment One, CS351 S2001

Artificial Software Aging

Objective

There are two objectives in this assignment:

Specs

For now the specs are very simple. Write your own C++ program which reads standard input and writes the same lines to standard output, sorted in lexographic order. We'll use standard ASCII order so you can ignore capital letters. The standard input will not end in an unterminated line.

Please include your source code, Makefile, and any testing scripts you may have constructed. You should not include (or have in your CVS archive) any derived or extranious files, including object code or editor backup files. The executable generated by calling make should be called sort-lines. It should take standard switches for the version number and for usage instructions (--version, --help). Behavior of both is governed in the Gnu Coding Standards. It should build and execute without error on standard UNM CS Debian GNU/Linux machines. It should handle illegal usage or error conditions as gracefully as practical. It should not be slow or ugly. It should include a debugging option (--debug) that monitors operation with trace statements. All output should go to the appropriate output stream, stderr or stdout. The program's exit condition should correctly reflect the invocation's status - either return 0 if there are no errors or send an error message to cerr and return 1.

Example:

$ cd your-handedin-dir
$ make
$ ./sort-lines <<EOF
> the
> quick
> brown
> fox
> jumps
> over
> the lazy
> dog.
> EOF
brown
dog.
fox
jumps
over
quick
the
the lazy
$

Handing in your code

Please ``export'' the assignment directory from your CVS repository, move it to a CS machine, and run
 ~bap/bin/cs351-handin exported-dir-containing-assignment
This command is not currently enabled, but will be functional before this weekend. Do not send your assignment by email.

Due date: 11:59pm Sun Jan 28.