Updated on June 6, 2002

Introduction

The section of the site provides access to the laboratories created for freshman computer science using the Java Power Tools to create graphical user interfaces designed specifically for the problems examined.

Picture Class Explorer

The Picture Class Explorer Laboratory is a first exploratory lab to illustrate the key properties of classes and objects. Students create an object instance of a Picture object and execute different methods in the Picture class using a graphical user interface. They also learn about the coordinate system in a graphics window.

Turtle Explorer

The Turtle Class Explorer Laboratory allows students to explore the behavior of a Turtle class - observe the changes in the member data in response to method calls with desired parameters. The syntax of the method calls is recorded in the console and is used to be inserted into the draw() action of the application. Students modify the TurtleExplorer.java file by inserting the body of the draw() method.

Ticker Seller

The Ticket Seller Laboratory focuses on reading code for an application that contains a complete GUI. In the process students learn about creating object instances and do some code modification to learn about program development steps: editing, compiling, running. They also learn about JPT GUI-based I/O via TextFieldView and Annotation. Students modify only the TicketSeller.java file.

Scaled Pictures

The Scaled Picture Laboratory is designed to teach students how to create scaled images using a simple subset of the Java2D Graphics package. They also observe the use of abstract classes and derived classes. Students modify the ScaledPictureApplication.java file, implement most of the code in the Face.java file, and create a new StudentPicture.java file.

Animated Loops

The Animated Loops Laboratory focuses on practice in writing loops both counted and conditional in the context of interesting simple animations. Two problems focus on the loop pattern where the new value in one iteration becomes old the value in the subsequent iteration. Students modify only the AnimatedLoops.java file.

Swimming Fish

The Swimming Fish Laboratory is designed to teach students to create a simple algorithm that involves a non-trivial use of decisions. The GUI provided for this lab creates a maze for fish to traverse and allows the user to select one of three possible algorithms. The fish progress is animated. The programmer implements one cycle of the traversal, using the Fish class member functions freeToMove and move(direction). The students modify only the MazeAlgorithm.java file.

Dot Patterns

The Dot Patterns Laboratory is designed to teach students about patterns that arise in nested loops. Students are asked to program 15 patterns of increasing difficulty and may optionally add 5 patterns of their own design. Each pattern is encapsulated as an object that extends the general DotPattern class. Students learn in a concrete way how to modify the methods of a base class at the moment an object is being instantiated by on-the-fly extension.

Simple Time

The Simple Time Laboratory is designed to teach students about building a class in Java that is elementary but has some non-trivial issues. The SimpleTime class supports working with time in total minutes or in hours and minutes. The class permits addition or subtraction of times so it may be used by other classes that deal with scheduling events of some kind.

Array Tools

The Array Tools Laboratory is designed to teach students about building array algorithms for Java arrays of type int[] and double[]. The code is tested using a simple modification of the automatic Problem Set Framework.

Box3D

The 3-Dimensional Box Laboratory is designed to teach students about basic patterns in building classes such as the relationship between constructors, set functions, and get functions. In the Box3D class, students will also learn about dealing with 1 and 2 dimensional arrays since the vertex list of a box is a 1-dimensional array and the edge list is a 2-dimensional array. Students will also learn the principle of recursion in its simplest setting which is to generalize an operation on a single point to a 1-dimensional array of points and then to a 2-dimension array of points. To make the program visually appealing, the lab provides a Box3DViewer to show the boxes in perspective projection.

Animated Algorithms

The Automatic Array Algorithms Animation Laboratory is designed to teach students about the following array algorithms in an object-oriented framework:

The student will write code as if it is operating on a simple class IntArray that encapsulates a pure Java array of the form int[]. The application will in fact execute the code on a derived class BarChart that automatically animates the algorithm encoded by the student. The laboratory continues the object-oriented theme of Encapsulate Action as Object that is used in earlier laboratories.

Stack Pictures

The Stack Pictures laboratory is designed to provide students with exposure to the Stack data structure. The traditional methods of a Stack are specified in an ADT encapsulated in a Java interface. The student writes two implementations of the ADT: one built using the dynamic array design pattern, and one built by adapting a Java Vector using delegation.

Implementations are tested in an environment where a number of independent stacks, containing Color objects, are placed next to each other to form a picture. Within the graphical user interface, students can also view the picture as drawn by an implementation known to be correct. The application is capable of displaying stacks as push-down (the cafeteria tray metaphor) or pile-up (the office inbox metaphor).

Soda Machine

The Soda Machine laboratory is designed to provide the student with exposure to the Queue data structure, and a small measure of Java GUI programming experience. The traditional operations of a Queue are specified in an ADT encapsulated in a Java interface. The student writes an implementation of the ADT by storing data in doubly-linked nodes, which they create from scratch.

The remaining tasks for the exercise involve minor modifications to the graphical simulation. Instructions for these tasks are extremely detailed, in order to reduce student confusion because of the number of provided Java classes. While this laboratory will not teach a student how to produce a full GUI, it will help student confidence and understanding of what goes into a Java GUI.

Implementations are tested in the simulation through student interaction with the soda machine. Automatic testing of the student implementation is performed in the background, and the student is notified through error messages if the implementation is performing operations incorrectly. An implementation that is known to be correct is provided with the student laboratory files, in order for the students to interact with the soda machine before attempting the exercise tasks.

Data

The Data laboratory is designed to be a flexible environment where the student can manipulate raw data in various meaningful ways. The graphical interface enables the user to load, edit, save, transform, and inverse transform, raw data. All data loaded into the application can be viewed as ASCII text, a binary digit string, an octal digit string, a hexadecimal digit string, or as a PPM image. Filters are provided to perform simple image compression, Caesar Cipher encryption, basic steganography, and otherwise manipulate the data.

The student is asked to write additional filters that perform manipulations of varying complexity, from colorization of grayscale images to decryption of arbitrary Caesar Cipher encoded text. Additional tasks, or alternate algorithms to perform the same tasks, are described for extra credit.

Warehouse

The Warehouse laboratory is designed to familiarize the student with the concept of a device driver in a context that represents a simplified memory management problem. A two-dimensional warehouse floor is organized into a table of equal sized cells, each of which is capable of storing one parcel. Parcels are placed in and removed from the warehouse by a crane, whose operations are controlled by a device driver. The operations for a device driver are encapsulated in a Java abstract class. The student writes several implementations of this abstract device driver, each more complex than the one before.

Implementations are tested and evaluated through the interface, which simulates application of the device driver to various warehouse conditions. All parameters for the simulation are user-controlled, including random number generation. Statistical information regarding the efficiency and correctness of the device driver is collected and displayed to the user. The student is asked to produce device drivers of better quality than the provided example device drivers.

Contact Information

The Java Power Tools team:

Name E-mail Telephone
Viera Proulx vkp@ccs.neu.edu 617-373-2225
Jeff Raab jmr@ccs.neu.edu 617-373-5876
Richard Rasala rasala@ccs.neu.edu 617-373-2206

To send e-mail to the enitre Java Power Tools team, use: jpt@ccs.neu.edu

Our postal address and fax number are given below:

College of Computer Science
161 Cullinane Hall
Northeastern University
Boston, MA 02115 USA
Fax: 617-373-5121