A Simple Cup o' Java

Due Date:  Thursday March 9, 2000 at 8:00 am

Jim's Sample Solution

Assignment:
There are three parts to this assignment"
1. Copy the Java applet that is on page 25 and 26 of D&H into a .java file and compile it to produce a .class file. Leave out all comments except for an opening comment that has your name, section and the lab number.
2. Modify the .html file on page 17 to run this new Java applet
3. Add a new web page to your set of pages that has links to the remaining labs (Lab 7 - 13) and link this applet to the Lab 7 link.

Background
This is like the first Robot lab in that we want to introduce you to the Java world of programming. Java has something like the simulator in the way of software. The instructions for using this stuff will be given in class and WILL NOT be typed up. They are in the reading but you might find the lecture easier to follow. You definitely need to come to class.

The applet file has lots of comments. Generally comments take three forms in Java
1. they begin with two slashes // and extend only to the end of the line
2. they begin with a /* and can end many lines later with a */
3. they begin with a /** and can end many lines later with a */

You should study the comments in this applet very carefully as they explain what the code is doing.
Your work in the next three weeks will be more "comfortable" if you go over these comments carefully. We will work through and explain all of this stuff in the next 5 weeks. However these comment would require a lot of extra typing and we want to keep you level of carpal tunnel syndrome to a minimum. Therefore you must leave out all comments in your .java file except for an opening comment with your name, section, and lab number.

Handin Instructions:
Create a folder named according to the tradition of the first six labs. Put the .html and .java file into that folder. DO NOT HAND IN THE .class FILE!

FTP your folder to the usual place. Look for a folder marked Lab7.


15-120 Spring 2000                                                                   Lab 7

Back to 15-120 Assignments