CPSC 120 -- Test #3 Review Topics
- Loops (Sections 5.5 (while), 5.7 (do...while),
5.8 (for loops - plus "Reading from Text Files" part of
the section "Iterators and for Loops"),
Labs 7 - 10, class notes, quizzes)
- Know the three basic loop structures and the differences
among them; given a loop of one type (for example, while) be able to
write an equivalent loop of another type.
- Be able to trace a loop to determine what it does - this includes
showing values of variables as it executes, showing what it prints,
or giving a verbal high-level description (such as finds the product
of the multiples of 3 from 1 to n).
- Be able to write loops -- be able to correctly control
the loop (write the appropriate boolean expression for the loop control
condition, initialize any variables in that expression (loop control
variables) before the loop, update those variables correctly
inside the loop).
- Know what is meant by a count-controlled loop (and how to write one)
and a sentinel controlled loop (and how to write one).
- Be able to perform common looping subtasks -- summing, counting,
finding averages, finding products,
finding max and min values. Be able to use a loop
to go through a string character by character and do something such
as count a particular type of character or find the first character
after a blank. Be able to use a loop to ensure valid input (keep
making the user enter values until the value is in the correct
range).
- Be able to write and understand complex loops containing method calls,
conditions, and other loops (nested loops).
- Objects and Classes (Sections 3.1, 4.0-4.4, Labs
5 - 10,
class notes and handouts)
- Understand the difference between objects and primitive values, including
the difference in how they are stored (directly vs. references). (Section 3.1)
- Know what an alias is and what garbage is! (Section 3.1)
- Be able to create (instantiate)
an object given the type signature of one or more
constructors and
be able to use an object appropriately given the type signatures and
reasonable documentation for its methods. (Chapters 3, 4, 5!!!)
- Understand the difference between static and instance variables, and
when each should be used. Understand why we often make constants in a class
public and static and how a client program can access them.
- Understand the difference between static and instance methods, how each
is accessed, and when each should be used. (Section 3.6, the Math class,
Self Review Question SR 4.11 on page 201)
- Be able to write a class given a description of the capabilities required
of it. (Section 4.4)
- Understand the meaning of the public and private modifiers
and when each is appropriate.
- Understand the meaning of encapsulation. (Section 4.3)
- Methods (Sections 4.3, 4.4, Labs 5 - 10, class notes
and handouts)
- Be able to write a method to perform a given task. (Section 4.4)
- Understand the role of the toString method - what it does
and how it is used implicitly when an object is included in a print
statement. Understand what happens if you try to print an object
for a class that does not have a toString method. (Lab 6 - the Student
class)
- Understand all components of a method's signature -- public/private,
static/instance, return type, method name, formal parameters. (Section 4.4)
- Understand what it means for a method to return a value, and be able
to both write and use such methods. In particular, understand the
difference between a method that has void return type and one that
returns a value. (Section 4.4)
- Understand the difference between formal and actual parameters,
and how both primitive values and objects are passed to a method.
(Section 4.4)
- Understand the scope of identifiers - where formal parameters
can be referenced, where local variables can be referenced,
where instance variables can be referenced. (pp. 166-167, 175-176)
- Graphical User Interfaces (Sections 3.9, 4.7 - 4.9, plus
Section 3.6 (Wrapper classes), notes, Lab 8)
- Java components (containers, frames, panels, buttons,
textareas, textfields, labels) - know the basic ideas for working with these;
know the difference between a frame and a panel, know what lightweight
and heavyweight containers are
- Events - know what an event is, know how your program can find out
which component triggered an event, know the connection between events
and listeners
- Listeners - know what a listener is, know what an ActionListener is,
know what method one must implement to implement an ActionListener,
know what one must do to set up a connection between a listener object
and a component.
- Know how to get the contents out of a textfield, know
what type that data is, know how to convert it to a numeric type (int
or double) if necessary, understand when it is necessary to do the
conversion, know how to put something into a textarea, textfield
or label (and know what type of data that must be).
- Know what Java Wrapper classes are (section 3.6) and that you are using
methods from those classes when you use the parseInt, parseDouble, and
toString methods
to convert from Strings to int or double and the other way around.
- Logic (Handouts)
- Know the basic laws of logic (DeMorgan's laws, distributive law,
associative law, commutative law, idempotent law, etc.).
- Understand the connection between logic and computer circuits --
be able to write a logic statement equivalent to a given circuit, be
able to simplify the statement using the laws of logic and then draw
the simpler circuit
- Be able to construct circuits given either a truth
table for the output or a verbal description of the output of the circuit.