CSC 161 Schedule Readings Labs & Projects Homework Deadlines Resources

Project: Robot Logging Suite

Summary: You will write a "robot logger" program robot-command.c that can log actions to a file and also read and perform actions from a file.

Details

You should use command-line input flags to specify whether the robot is in "read" mode (reading actions from a file), "write" mode (logging actions onto a file), or both "read" and "write" mode. When no files or flags are specified, I/O should happen through the terminal.

In particular:

This program should support at least 10 different actions (following the Project 3 command requirements). As with that project, each action (except, perhaps, quit) must be implemented as a separate procedure.

Examples

The following examples are based on a program robot-command that supports this project. Although this table shows several possibilities, the table is not complete. For example, various combinations of -r and -w are possible, with and without file names, and the -r and -w flags could be in either order.

Command line Interpretation
./robot-command no command-line arguments, so reads from stdin and writes to stdout (facilitates shell redirection)
./robot-command -r infile.dat reads commands from file infile.dat; writes to stdout
./robot-command -r reads from a file; because no filename is given on the command line, program must ask user what file to use; program writes to stdout
./robot-command -w logfile.dat reads from stdin; writes commands with parameters to file logfile.dat
./robot-command -w reads from stdin; writes commands with parameters to a file; because no file name is given on command line, program must ask what file to use
./robot-command -w logfile.dat -r infile.dat
OR
./robot-command -r infile.dat -w logfile.dat
reads commands from infile.dat, writes commands with parameters to logfile.dat
./robot-command -r infile.dat -w reads commands from infile.dat; writes comands with parameters to a file; because no log file name is specified, user must be asked for the filename

Notes

Grading

Submit files robot-command.c, references.txt, and tests.txt, example1.txt, example2.txt.

In addition to the general grading guidelines for evaluation, the project is worth 25 points.

A five point penalty will apply to any submission that includes personally identifying information anywhere other than the references/honesty file.