COSC 122 Programming II Final Examination Study Guide
The material presented in this guide covers the concepts emphasized on
the final examination.
It is meant to guide students studying and reviewing for the exam;
it is not guarranteed to be comprehensive.
Actual test questions will differ from the examples given here.
Students should use this guide in addition to other study activities
(like reading the book(s), reviewing completed assignments and
old quizzes, etc.)
The final examination will be based primarily on
Chapters 1–11.1 of the Halterman book. For additional
study material, you may consult Liang
Chapters 1–16, 21, 28.
-
Know the following concepts. Understand where they apply
and when they should or could be used. Know how to apply them
in a programming context.
- Identifiers, naming and using
- Java's primitive types and their wrapper classes.
- Arithmetic with variables and literals, integer arithmetic
vs. floating point arithmetic, mixed arithmetic,
the limitations
of floating point representations, constants
- Boolean expressions involving relational operators and
logical connectives:
==,
!=,
<=,
>=,
<,
>,
&&,
||,
!
- Conditional statements: if/else, switch,
and the conditional operator
- Loops: while, do/while, and for
- Classes: defining and using, packaging, fields, methods,
instance vs. class variables, instance vs. class
(static) methods, native methods, recursion, etc.
- Methods: defining, invoking, parameter passing, local
variables, call by value, method invocation vs.
definition, formal vs. actual parameters,
overloading vs. overriding, method signatures.
- Constructors, overloading constructors, super
this when used in constructor definitions.
- Objects, classes vs. objects, instancing, using new,
reference variables vs. primitive types,
reference assignment, object aliasing, garbage and
garbage collection
- Java memory model: stack, heap, and static memory
- Java keywords that influence the design of classes:
public, private, protected,
static, abstract, final, etc.
The two uses of the keyword final.
- Inheritance and issues involved with inheritance:
is a relatonship, overriding methods, polymorphism,
super classes and subclasses, the extends
keyword, abstract vs. concrete classes
- Java interfaces: defining, using, can do relationship
- Composition and issues involved with composition:
composition (has a) vs. inheritance (is a),
delegation, aggregation
- The Unified Modeling Language, as used in class
design: class structure, inheritance, composition.
- Swing Graphics in Java: graphics context,
components,
layout managers, event listeners, applets.
- Exceptions: defining, catching, throwing,
declaring, checked vs. unchecked exceptions,
the Exception class hierarchy
- Generics: defining and using.
- Be able to do the following tasks.
- Answer multiple choice, matching, true/false, fill in the
blank, and similar type questions. These may refer to
basic concepts, simple coding examples, etc.
- "Playing computer;" that is, examining a code fragment and
determining what that section will do. This may be in the
form of answering questions such as:
- What will printed?
- How many times will x occur?
- What will the value of x be?
- Writing classes.
- Be able to provide a the Java source code for a
class given the specifications for its missing details.
For example:
A Summation
object is used to compute the sum of all the integers
between two values, inclusive. For example,
Summation s = new Summation(10, 15);
System.out.println(s.sum());
displays 75, since 10 + 11 + 12 + 13 + 14 + 15 =
75. Provide the complete Java class implementation
for the Summation class.
As another example,
develop a class named Counter. Counter
objects, obviously, can be used to count things. These
objects work in a fashion similar to turnstiles that
count people entering or leaving a building. A
Counter object should be able to do no
more or no less than the following:
- automatically be set to zero when created
- be able to be incremented by one
- be able to be reset to zero after being
created (for example, to count people entering
for a different event)
- be able to display its current count
Completely define the Counter class.
- Be able to derive a new class from an existing
class using inheritance or implement a given
interface.
- Be able to implement a class or collection of
classes from the UML diagram. Understand how
fields, methods, abstractness, access permissions,
etc. are represented in the UML.
During your study, take some time to reflect on what you have
done in the assignments.
If you have mastered the assignments, then you should not be overly
challenged by the programming parts of the test. On the other hand,
if you don't
understand all of the assignments completely, (for example, your teammate
did all or most of the work), then some of the programming problems
may be challenging.