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:
- 20 points: linear and binary search for int, double, String, or Comparable
- 20 points: selection or insertion sort for int, double, String, or Comparable
         
         
in forward or reverse order.
- 10 points: questions about order of operations (how long does it take ...)
         
         
You must show how you got your answer.
         
         
(like the ones we have been doing at the beginning of class)
- 10 points: two-dimensional array problems
         
         
(like the ones from the recitation and Tic Tac Toe case study)
- 10 points: String manipulation problem
         
         
(like the ones from the recitation 4 and 9)
- 10 points: Array of objects problem
         
         
(like the ones from the recitation 9)
- 10 points: trace both selection and insertion sorts
         
         
(like handout from class)
- 10 points diagram trace
         
         
(like on Exam 2, but including an array of objects)
         
         
(See the problem below for an example.)
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();