CS 124, Fall 2011
Information on the Final Exam

The final exam for this course is scheduled for Wednesday, December 14, at 8:30 AM. It will be held in our regular classroom. The exam will be six pages long (compared to four pages for the two in-class tests). It is a cumulative exam, with some emphasis on material that was covered since the second test. You can expect questions that are generally similar in kind to those on the in-class tests. The final exam counts for 20% of your grade for the course.

Since the second test, we have worked on material from Chapter 5, Sections 5 through 7; Chapter 6, Sections 4 through 8; and Chapter 7, Sections 3 and 4. We did not, however cover every topic in these sections. You should pay attention to what was covered in class and in lab, and to the list of topics below.

The last question on the test will be a 20-point, full-page essay question on the topic of program development and how it is supported by the Java programming language. Topics related to program development include pseudocode, step-wise refinement, modularity, top-down and bottom-up design, object-oriented programming, design of classes and class hierarchies, state machines, and the design of event-driven GUI programs. You should be prepared to write a coherent and thoughtful essay on this topic.

You should review the information sheets for the first test and the second test, but here is a list of some of the most important things from that material:

machine language, high-level programming languages, and compilers
the Java Virtual Machine
the javac command for compiling a Java file on the command line
the java command for running a Java program on the command line
syntax and semantics
the basic syntax of the Java langauge
literals, variables, expressions, and operators
Java's primitive types
System.out.print(x), System.out.println(), and System.out.println(x)
TextIO methods:  TextIO.getln(), TextIO.getlnInt(), TextIO.getlnDouble()
methods in the Math class:  Math.random() Math.sqrt(x)
String methods:  str.length(), str.charAt(), str.equals()
control statements: if, while, for
exceptions and the try..catch statement
some common exceptions: NullPointerException, ArrayIndexOutOfBoundsException,
   IllegalArguementException, IllegalStateException, NumberFormatException
how to throw an exception, and why you might want to do so
programming style rules and why they are important
subroutines and parameters; formal parameters vs. actual parameters
modularity (black boxes; separation of interface from implementation)
the access modifiers "public" and "private"
return types and the return statement; void
the dual nature of classes: the static part and the non-static part
scope of a variable; local variables vs. member variables
named constants and the "final" modifier; why named constants are used
packages; important classes from packages
classes and objects
instance methods and instance variables
instance variables represent "state" of objects; methods represent "behavior"
getter and setter methods and why they are used
pointers, references; null; assignment and equality-testing for objects
constructors; calling a constructor with "new"; classes as object factories
the default constructor for a class that does not define a constructor
garbage collection
arrays; elements of an array; length of an array; index of an element in an array
two-dimensional arrays
using nested for loops to process two-dimensional arrays
each row of a two-dimensional array is actually a one-dimensional array
using "new" to create arrays
using for loops to process arrays
basic array processing such as summing, counting, finding a max
random access to array elements
the ArrayList class
ArrayList methods; list.size(), list.get(i), list.add(x)
using a for loop to process an ArrayList

Here is a list of some of the things covered since the second test:

extending a class
subclasses and superclasses
inheritance
class hierarchies
object-oriented programming
the access modifier "protected"
class Object; every class is a direct or indirect subclass of 
abstract classes and abstract methods
interfaces (i.e. the Java reserved word "interface")
writing a class that implements an interface
types in Java:  primitive types, classes, interfaces, and array types
the special variable "this"
using "this" to access member variables hidden by local variables
the special variable "super"
using "super" to call a method from the superclass
nested classes; static nested classes vs. non-static nested classes

arrays of objects
partially full arrays; using a counter to keep track of how many elements are used
searching and sorting arrays
sorting algorithms: selectionSort
linear search vs. binary search  [ but not the details of the binary search algorithm ]

And here are some aspects of GUI programming that you should know:

the basic packages for GUI classes:  java.awt, java.awt.event, javax.swing
using the Graphics class for drawing;  g.drawRect(x,y,w,h), g.fillRect(x,y,w,h),
   g.drawOval(x,y,w,h), g.fillOval(x,y,w,h), g.drawLine(x1,y1,x2,y2),
   g.drawString(str,x,y), g.setColor(c)
colors; color constants such as Color.RED and Color.BLACK; new Color(r,g,b)
The JPanel class
using a JPanel as a drawing surface; repaint() and paintComponent()
layout and layout managers
BorderLayout and GridLayout
using a JPanel as a container for building complex GUI layouts:
    panel.setLayoutManager(layoutManager), 
    panel.add(component)  [ for GridLayout, or null layout ]
    panel.add(component, BorderLayout.position) [ for BorderLayout ]
events, listeners, and event-handlers
representing the "state" of a program in instance variables
the paintComponent() method; calling super.paintComponent(g)
the paintComponent method should look at state variables to decide what to draw
event-handling methods can base their action on current state and can change the state
calling repaint() when the state is changed
listener interfaces; ActionListener and MouseListener
the ActionListener interface:  public void actionPerformed(ActionEvent evt)
ActionEvent methods: evt.getSource(), evt.getActionCommand()
the basic MouseListener method:  public void mousePressed(MouseEvent evt)
MouseEvent methods:  evt.getX(), evt.getY()
the basic idea of input focus and keyboard event processing
registering event listeners; methods such as addActionListener, addMouseListener
basic components:  JButton, JTextField, JLabel
using getText() and setText() with buttons, textfields, and labels
adding an ActionListener to a JButton
timers and animation