Graphic by Keith Ohlfs

CS111, Wellesley College, Spring 1998

Problem Set 5

Due: Friday, March 13 by 4:00 p.m.

[CS111 Home Page] [Syllabus] [Students] [Lecture Notes] [Assignments] [Programs] [Documentation] [Software Installation] [FAQ] [CS Dept.] [CWIS]

This problem set has working applets, which do not print out. Click here for a printable version of this problem set with images instead of applets.

About this Problem Set

There are 3 pieces to this problem set: the prelaboratory assignment, the laboratory assignment and the homework assignment. You are required to do all three parts. We recommend that you do the prelaboratory assignment before your lab section, the laboratory assignment during your lab section and the homework assignment after completing the prelab and lab assignments.

How to turn in this Problem Set

Prelab Assignment: You do not need to turn in anything for the prelab assignment.

Laboratory Assignment: Save the modified GUICalc.java file in the GUICalculator folder. Upload the entire folder to your ps5 drop folder. Turn in a hardcopy of the GUICalc.java file.

Homework Assignment: Save the modified GUIPictureWorld.java file in the GUIPicture folder. Upload the entire folder to your ps5 drop folder. Turn in a hard copy of the GUIPictureWorld.java.

Turn in only one package of hardcopy materials. Staple your files together with the cover page, and submit your hardcopy package by placing it in the box outside of Jennifer's office (E104, directly across from E101).

Reminders

Prelaboratory Assignment

Creating a simple GUI panel

In the lab assignment, we will be setting up the layout of a simple calculator. One of the pieces of the calculator takes some time to type in, so it will make your life easier if you create it ahead of time. In this assignment, you will create the number buttons for the calculator. This group of buttons looks as follows:

To create this set of buttons, do the following:

Laboratory Assignment

Designing a Calculator GUI

You have seen some basic Graphical User Interface Design in Lecture. Today in lab you will practice creating the components of the user interface and arranging them in panels. We will create the following calculator:

Getting Started

Download the ps5_programs folder from the CS111 download folder. Open the "GUICalculator" folder. Open the GUICalc.proj file. Look at the GUICalc.java file. Fill in the method stubs provided to create the above calculator layout. We will work on this together in lab. The buttons do not actually have to do anything for this assignment.

When you are finished modifying the GUICalc.java file. Save it in the GUICalculator folder. Upload the entire folder to your ps5 drop folder. Turn in a hardcopy of the GUICalc.java file.

Homework Assignment: A User Interface for PictureWorld

In lecture we have been exploring how to build up complexity by combining primitives and abstracting the results. Using the PictureWorld methods, we have been able to create beautiful and complex quilts and knit patterns. With the current implementation of PictureWorld, in order to test out a given method, we must alter the java code, recompile and then reload the applet. As a teaching tool, it would be nice to have a user interface that one could use to demonstrate how PictureWorld works. That is, we would like to be able to click on a button and see a picture turn 90 deg when we apply the "clockwise90" method to it. Your task in this homework assignment is to create the layout for such a user interface.

The PictureWorld GUI Layout

We have designed the following user interface for use with PictureWorld (Note for this assignment the buttons don't actually do anything):

The interface is intended to work as follows:

Fortunately, you do not have to create a working version of this user interface in this assignment! You merely have to reproduce the layout shown in the applet above.

To help you recreate the layout, take note of the following:

Creating your PictureWorld Layout

Open the Pictures.proj file from the GUIPicture folder in the ps5_programs download folder. Open the GUIPictures.java file. This files contains some method stubs for creating your User interface.

Handing in the Homework Problem

When you are finished writing the code for the GUI layout in GUIPictureWorld.java, save the modified file in the GUIPictures folder. Leave all the other .html, .java, .proj and .class files in this folder. Upload the entire folder to your ps5 drop folder on the CS111 server. Turn in a hardcopy of the GUIPictureWorld.java file.