CS 1713 Week 15:
Review
Objectives:
- Review for the final examination.
Day 41:
Review
Day 42:
Review and work examples
Final examination:
Comprehensive Programming Skills but emphasizing the later material,
particularly strings, loops, interfaces and arrays of objects.
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.
- Trace the following code segment. (Since this wasn't on either exam,
you can expect a problem on the final.) 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. You should
also number the order of the references.
- Draw a picture of the variables and objects after the following code
is executed. (As you probably have already figured out, I really like this
kind of problem so you can expect to see it on the final.)
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, protected, 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 should be able to define the term, describe why it is useful and be
able to give specific examples.
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).
- Can't have nested scope in methods.
- Parameter's scope is the method.
- Good practice to give variables smallest scope possible.
Linear search, binary search and the selection sort algorithms:
- You should be able to reproduce the algorithm or its variations (ascending
versus descending, objects rather than 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.
Things you will not be tested on:
- File I/O
- Graphics
- The
insertionSort
Last Revision: August 21, 2002 at 11:15 am