Computer Science 124:
WELCOME TO the on-line lab worksheets for Computer Science 124: Introductory Programming, a course in Java programming that was taught in Winter term 1998 at Hobart and William Smith Colleges by David Eck. The labs for this course used the Visual J++ program development system. However, all the programs are here, so you should be able to use the labs with other Java development environments. To learn more about the course, please see the information page. In particular, you might want to take a look at the online text that was used.
The labs are available for downloading. See the bottom of the page.
You are welcome to do anything you like with these lab worksheets, except claim credit for them.
- Lab 1: Introduction to Java, Visual J++, and the Web
- Lab 2: More on Programming and Visual J++
- Lab 3: Subroutines (Part 1)
- Lab 4: Subroutines (Part 2)
- Lab 5: Applets and Objects
- Lab 6: Applets and Objects II
- Lab 7: Arrays
- Lab 8: Two-dimensional Arrays (and more)
- Lab 9: Sorting and Layout Managers
- Lab 10: Files, Networking, and Streams
Here are answers to most of the exercises from the labs:
Lab number          
Basic Source Files for Console Applications
Many of the programs in these labs use a "console." A console is a window that supports a basic sort of interaction or dialog between the program and the user. If you use a console in a program, you'll need two classes, Console.class and ConsoleCanvas.class. These must be in the same directory with the class that defines the main program which uses the console. The source code for these classes can be found in the files Console.java and ConsoleCanvas.java.
Some of the lab worksheets use "console applets." A console applet supports the same kind of interaction as a console window. If you want to write console applets, you'll need the ConsoleCanvas.java as well as the following two files: ConsolePanel.java and ConsoleApplet.java. Another file, MyApplet.java is an example of a simple console applet.
You can download the lab worksheets for use on your own computer. (You can also post them on your own Web server if you want.) They are available in three forms:
David Eck, March 27, 1998