CMPS 060G    Fall 2002    Homework Assignments


Homework (IF WRITTEN) is due at the beginning of class on the due date if it is a written assignment.  Work all problems carefully and neatly, show all work, and justify all answers.  Place the following information at the top of the first page:
Your name
Student ID#
CMPS 060G  Fall 2002
The name of the assignment (i.e. hw1, hw2, etc.)
Please staple the pages of you assignment together.  If for some reason you must turn in loose papers, make sure you name is on each page.
 

  Homework (IF A PROGRAM):
 
Homework is due by midnight the night it is due.  Late homework will not be accepted.
 
Working Together: The graded programming assignments are to be done by each student, working alone. You should treat these assignments like takehome exams. You may freely give and receive help with the computer facilities, editors, UNIX, debugging techniques, the meaning and proper use of Java constructs, etc.. You should not discuss the graded programming assignments with other students until after they are turned in. In particular you should not view another person's program, or allow someone to view any part of your program, prior to turning it in. Obviously, copying any part of another person's program, or allowing your program to be copied is not permitted. A program will be in use to detect copying. If you have any questions on this important point, please see me.
 
Each file that is turned in must contain a header comment. This is a comment that comes at the begining of your program file and tells the authors name, (CATS) email address, name of the file, date, description of the file, and notes about the file. Here is an example:
 
/*===================================
* AUTHOR: Ian Brown
* EMAIL: ian@somewhere.edu
* FILE: HomeWork1.java
* DATE: September 26, 2002
* DESCRIPTION: This file was written for homework 1.
* NOTES: You should put whatever notes to the grader you need,
* here. This will include bugs and other erata; possibly
* describing the unfinished nature of the program. Or how to compile it.
*===================================*/

 
For each of the programs in this homework you should submit a different .java source code file. Name them hw1a.java, hw1b.java and hw1c.java.
 
When submitting homework, use the following command:

  submit cmps060g-rc.f02 hw1 filename.java

  submit is the name of the CATS program you use to turn in your homework. cmps060g-rc.f02 is the name of the homework locker (directory) where your files are submitted. hw1 is for the homework 1 folder in the cmps060g-rc.f02 locker. This designation will be hwn where n is the number of the homework assignment, for the rest of your assignments. filename.java is the file name of your own .java} source code.

In order to do the homeworks you need to use the tio.jar package. You can get this by doing:


wget ftp://ftp.cse.ucsc.edu/pub/charlie/jbd/tio.jar

It is best to do this in your 60g directory because it will retrieve the tio.jar package and put it in your current directory.

Next you need to let the java compiler know where this is so it can use it to compile your programs. You do this by setting an environment variable in your shell called CLASSPATH.

If you are using the bash shell add the following line to (the end of) your .bashrc file. The .bashrc will be located in your home directory if it exists, if it does not exist then create it (enter 'cd' to get to your home directory, use 'pico .bashrc' to edit it).
If you do not put the tio.jar file in your 60g/ directory then you will need to modify the following line to show where you put it.

export CLASSPATH=:$HOME/60g/tio.jar

If you do not know what your shell is, or even what a shell is, then you are using 'csh' which is the C shell. Then you need to add the following line to (the end of) your .cshrc file which is located in your home directory (enter 'cd' to get to your home directory, use 'pico .cshrc' to edit it). If the .cshrc file is not in your home directory, create it.

setenv CLASSPATH :$HOME/60g/tio.jar

You will need to restart your shell for this to take effect (logout and back in again.)


Assignment 1:  Due Thursday 10/03/02     (PDF
Assignment 2:  Due Thursday 10/10/02     (Problems 8, 14, 20 & 22 from chapter 3 of the book.) 
Assignment 3:  Due Thursday 10/17/02     (Problems 3, 5 & 10 from chapter 4 of the book.) 
Assignment 4:  Due Thursday 10/24/02     (Problem 20 from Chapter 4, Problems 3 & 4 from Chapter 5 of the book.) 
Assignment 5:  Due Thursday 10/31/02     (PDF)5.5  5.6 
Assignment 6:  Due Thursday 11/07/02     (DOC)6.4  6.5 
Assignment 7:  Due Thursday 11/14/02     (PDF
Assignment 8:  Due Thursday 11/21/02     (Problems 7 & 8 from chapter 6 of the book.) 
If you find any errors, please report them to the TA.