CS 1713 Introduction to Computer Science
Fall 2009 Exam 3 Information

Exam 3 will last 50 minutes and consist of questions worth a total of 100 points.
Most likely, the exam will consist of the following types of problems:

Note that you need to be able to complete a 20-point problem in under 10 minutes.

Practice writing the sort methods and time yourself to make sure you can do them fast enough.

Practice Problem:
Suppose Square is a class that has been appropriately written.
It has a constructor with one double parameter, its side.
Draw an accurate schematic diagram of the program variables showing the execution of the program.

double w = 2;
double x = 5;
double y = 7;
Square[] squares = new Square[3];
Square s;
s = new Square(w);
squares[0] = new Square(x);
squares[1] = s;
squares[2] = squares[0];
w = squares[2].getArea();
s = squares[2];
x = squares[1].getSide();
y = squares[0].getArea();
squares[2] = squares[1];
squares[2].setSide(9);
squares[1] = new Square(8);
y = squares[1].getArea();
x = squares[2].getSide();