HOME | Overview | Syllabus | Instructor | Lectures | Laboratories | Readings | Assignments | Resources | Other Links
CS 1711 Recitation Laboratory 10:
Arrays of Objects [11/15/99; 11/17/99]

 

Objectives:

Check-off procedure:

You must attend the recitation and sign in. This laboratory will be checked off using the new procedures.

Laboratory details:

In this project you will be working with and testing a class called VButtonPanel that has an array of buttons and methods for accessing them. The VButtonPanel is created by specifying an array of strings that contain the names of the buttons.

Part I: The Warm Up

Create a new standalone project called VPanelButtonMain. In addition to the main program (VPanelButtonMain.java), the project includes the classes defined in VButton.java and VButtonPanel.java given below. These should be available in the lab for you to copy into your savework directory. You should build and run this project and make sure that you understand how the classes work before proceeding.

Exercise I: Adding output method for debugging

Exercise II: Adding basic accessor and modifier methods

Exercise III: Locating a particular button in the panel

Exercise IV: Overloading the accessor and modifier methods

A user may want to access a button by its position, but more likely will want to access it by name. Add the following methods to VButtonPanel class to allow access by name. These methods have the same names as ones already in the class. The methods are said to be overloaded.

Build and run the program. Add additional test statements to the main program. Create a button panel object with 10 buttons in it to test.


Last revision: November 8, 1999 at 8:40 am.