Updated on June 6, 2002
DotPatternclass. 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.
SimpleTimeclass 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.
double. The code is tested using a simple modification of the automatic Problem Set Framework.
Box3Dclass, 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
Box3DViewerto show the boxes in perspective projection.
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.
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).
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.
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.
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.
The Java Power Tools team:
To send e-mail to the enitre Java Power Tools team, use: firstname.lastname@example.org
Our postal address and fax number are given below:
|College of Computer Science|
|161 Cullinane Hall|
|Boston, MA 02115 USA|