Overview Schedule Announcements Resources Assignments Home

CSC 121: Computer Science I, Spring 2005

In-Class Exercise: Introduction to BlueJ

Goals:
To understand the difference between classes and objects; To use the BlueJ programming environment
Getting started:
Copy the folder Shapes from the public folder on the I: drive to your personal folder on the I: drive.
Start up BlueJ.
  1. Open the Shapes project in your personal folder.
  2. Work through exercises 1.1-1.8 in your textbook reading the text and testing any code that you write by invoking the appropriate methods. Write answers to each of the questions.
  3. Open the class editor in turn for each of Circle, Square and Triangle. Note that each description begins with text similar to:
    public class Classname
    {
        private int apple;
        private int baker;
        private int charlie;
        private String dog;
        private boolean isVisible;
        . . . .
                           
    
    The first line (above) names the class and the following lines name the attributes (fields) used to describe the class.
  4. Write the names of the fields for each of the classes named Circle, Square and Triangle in the Shapes project.
  5. Close the Shapes project, exit BlueJ, and log out.
  6. Turn in your answers (with your name) to all of the above.
Overview Schedule Announcements Resources Assignments Home

Valid HTML 4.01!Valid CSS!DePauw University, Computer Science Department, Spring 2005
Maintained by Brian Howard (bhoward@depauw.edu). Last updated