Due: 10:00 AM, Monday, 10/013/08
This assignment is to implement a simple command line interface. That is, it allows the user to enter a series of commands to control execution of a program and shows the user the results of each command. This program doesn't have to actually execute the commands (yet); it just accepts commands from the user, checks them for errors, and displays commands in a standard format. Eventually, this kind of interface will be added to your game playing program.
The program should have a class named TestIO which contains the main method.
The main() method should accept commands from the command line, one command per
line. Commands are of the form
command parameter1 parameter2 ....
Optional parameters
are indicated by [parameter]. All commands are free-format, i.e., variable spacing before
and after commands and parameters, and not case-sensitive.
That means the command can be typed in upper or lower case characters, or a
mixture of both.
As each command is read, it is echoed to the screen. That is, it is printed on the screen exactly as it was entered. Then it is reprinted in a standard format to be described below.
The commands are:
> start
start
START
> Move 51 74
move 51 74
MOVE 51 74
> moove 34 14
moove 34 14
Illegal command
> SAve g1.gam
SAve g1.gam
SAVE g1.gam
> placE 4 21 6
placE 4 21 6
PLACE 4 21 6
> place 5 -8 2
place 5 -8 2
Illegal parameter: -8
>quit
quit
QUIT
It is not necessary to use exception handling in this program, but you may want
to. You don't need to put the program into a package. The default package is fine.
Add comment documentation to your program and use javadoc to extract the documentation into an HTML file. Include a javadoc comment for each class and each method. The class comment should include your name and the date (use the @author tag). Method comments should briefly describe the purpose of the method, its arguments, and what, if anything, it returns (using @param and @return as appropriate).
The physical location of the javadoc comments is critical. A class comment must immediately precede the line containing the keyword class, and method comments must immediately precede the method.
When you have commented your source files, run javadoc to create the .html files and view them in a browser of your choice.
Within this individual directory, create a subdirectory named p6. Copy only the source files into this directory, not class files or javadoc files. So, for example, if your login name was smithjd then the file TestIO.java, and any other java source files your program uses should be copied to /afs/cu/class/cs242/fa08/smithjd/p6. These directories have permissions set so that no one other than yourself and Prof. Lynch can read the files. You may, of course, use whatever operating system and compiler you wish to develop your code, but the version you turn in, both hardcopy and the files submitted to AFS, must compile and run under JDK installed in the Clarkson ITL (our lab room).