Lab 1 - Java, Unix, and Conway's Days of the Week
Due: Monday, September 20, 2004 at 9:00 AM
Getting Started
During lab today, you will learn how to use the Java environment from the Unix command line on the CSLab Mac systems and get some practice writing Java code.
source /Network/Servers/cortland.cs.williams.edu/Volumes/Courses/cs136/bin/136in the command window each time you log in. Rather than type this command every time, you can make it happen automatically by adding it to the file .local_bashrc in your home directory.
ls cd cp mv rm mkdir pwd man chmod cat more grep head tail ln find rmdir wc diff tar
Identify the function of and experiment with these Emacs Commands:
C-x C-s C-x C-c C-x C-f C-x C-w C-g C-a C-e C-d C-_ C-v M-v C-s C-r M-%
Learn these commands - you will use them often. Hints can be found in the Unix and Emacs web pages on the course website.
Make a subdirectory lab1 in this new directory for files related to this lab.
Lab Program
Write the Day-of-Week Calculator at the end of Chapter 1.
You should have two classes - one to hold the date and one to play the game. Be sure to document your program with appropriate comments, including a general description at the top of the file and a description of each method. Also use comments and descriptive variable names to clarify sections of the code which may not be clear to someone trying to understand it. Take this opportunity to practice using Javadoc as well.
Answer the four thought questions at the end of the lab. Put your answers in a plain text file conway.txt.
When you are finished, package up your Java source files for the odd number printer and the Conway game along with your file containing your answers to the thought questions into a "tar file" called conway.tar. Submit this using the turnin utility: "turnin -c 136 conway.tar" at the Unix prompt. This will copy your submission to a private area from which we will collect them for grading. The time you run turnin is recorded and this will be used to assign any appropriate late penalties. As in all labs, you will be graded on design, documentation, style, and correctness.