CS 1713 Week 15:
Review
Objectives:
- Review for the final examination.
Activities:
- Review for the final examination.
Readings: Review past readings
Final examination
The final exam will have 100 points wirth of problems and
last 150 minutes. This gives you 15 minutes to do a 10-point problem.
Comprehensive Programming Skills
Types of programming problems:
- Write a method to do X.
- Write a code segment to do X.
- Design a class with the following properties....
- Implement a specified interface.
- Instantiate objects of a specified class and use them to solve a problem.
- Draw an accurate schematic diagram of the program variables showing the
execution of the program.
Here are some hints:
- Represent each variable by a rectangle. For objects and arrays, this
rectangle will reference a more complicated structure which you should also
show.
- As the value of a primitive variable changes, you should display
successive values from right to left, crossing out the old values.
- For variables that hold references, the value will be represented
by an arrow to something else.
As the variable changes, indicate the old
reference is no longer valid by putting two short lines across it.
- Represent an object by a rectangle and show each attribute inside that
rectangle.
- Represent an array as a vertical list of boxes, each containing
an element of the array.
- You have examples of worked problems of this type from your exams 2 and 3
as well as here and here.
Object-oriented terminology:
- Field
- Variable
- Method
- Constructor
- Client code
- Class
- Object
- Class versus object
- Field versus method
- Accessor method versus modifier method
- Instantiation
- Polymorphism
- Inheritance
- Is-a versus has-a
- Overloading a method
- Overriding a method
- Overloading versus overriding
- Visibility - private and public
- Interface
- Abstract class
- Super class
- Sub class
- The this reference
- Type-cast
- The extends keyword
- The implements keyword
- The difference between extending a class and implementing an interface
- Exception
- Static method
- Static variable
You do not have to be able to write a definition of these, (except for object and class)
but you should understand them when used and be able to match them to
an appropriate description, as in problem 4 on Exam 2.
Scope and parameter passing:
- Given a code segment, you should be able to specify the scope of any
variable in the segment.
- You should be able to explain how parameters are passed to methods
and constructors.
- Scope rules and their implications in good design:
- Scope of variables restricted to block in which they are defined (from
the point of definition on).
- Parameter's scope is the method.
- Good practice to give variables smallest scope possible.
Linear search, binary search, selection sort, and insertion sort
algorithms:
- You should be able to reproduce the algorithm or its variations (ascending
versus descending, objects and primitive types).
- You should be able to trace the algorithm if given it.
- You should be able to show what the algorithm does on a specified
array, without writing down the algorithm or having it on the exam.
Your three exams are a good source for practice problems.
You can find some sample problems
here.
You can find some more sample problems
here.