CS 124, Fall 2017
Information on the Final Exam

The final exam for this course is scheduled for Saturday May 6, at 7:00 PM. It will be held in our regular classroom. The exam will be six or seven 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 previous tests. The final exam counts for 20% of your grade for the course.

The last question on the test will be a 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, subroutines, object-oriented programming, design of classes and class hierarchies, state variables, and the design of event-driven GUI programs. You should be prepared to write a coherent and thoughtful essay on this topic.

Don't forget that solutions to quizzes and tests can be found on the course web page. And answers to the end-of-chapter quizzes and exercises in the textbook are also available on-line.


Here is a list of some of the most important things from earlier in the course:

algorithm
machine language, high-level programming languages, and compilers
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
public static void main(String[] args)
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()
Math.random(); using Math.random() to make random integers (such as rolling dice)
String methods:  str.length(), str.charAt(), str.equals(), str.toLowerCase()
control statements: if, while, for
arrays; referring to array elements as for example A[i]
base type of an array
elements of an array
length of an array, A.length
index of an element in an array
using "new" to create arrays, for example:  new int[10]
using for loops to process arrays
basic array processing such as summing, counting, finding a max
exceptions and the try..catch statement
some common exceptions: NullPointerException, ArrayIndexOutOfBoundsException,
   IllegalArguementException, 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; dummy (formal) parameters vs. actual parameters
black boxes; and 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. global variables
named constants and the "final" modifier; why named constants are used
packages; importing 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; why instance variable are often private
pointers, references, null
assignment and equality-testing for objects
constructors; calling a constructor with "new"
extending a class
subclasses and superclasses
inheritance
class hierarchies
assignment rules for objects: 
     a variable of type Foo can refer to an object belonging to a subclass of Foo


And here is a list of some of the non-GUI things covered since the second test:

polymorphism
object-oriented programming
class Object; every class is a direct or indirect subclass of Object
the access modifier "protected"
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

abstract classes and abstract methods
interfaces (i.e. the Java reserved word "interface")
implementing an interface

two-dimensional arrays; using nested for loops with two-dimensional arrays
using a for-each loop for array processing
the parameterized type ArrayList<T>
ArrayList methods:   list.add(item), list.get(i), list.size(), list.remove(i)
using a for-each loop with an ArrayList
wrapper classes for the primitive types: Integer, Double, Boolean, etc.
Using ArrayList<Integer>, ArrayList<Double>, for lists of primitive type values

searching and sorting arrays
linear search
binary search  [ but not the details of the binary search algorithm ]
sorting algorithms: selectionSort
how to think about the efficiency of an algorithm
why binary search is so much faster than linear search

We have covered a lot of GUI stuff in labs and class. Here are some things 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)
using a subclass of JPanel for drawing; the method paintComponent(g)
colors; color constants such as Color.RED and Color.BLACK; new Color(r,g,b)

elements of GUI programming:   components, layout, events, graphics
the idea of layout and layout managers; BorderLayout, GridLayout, FlowLayout
using a JPanel as a container for building complex GUI layouts
the idea of events, listeners, and event-handlers
representing the "state" of a program in instance variables
a 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
repaint() should be called when the state is changed
event-listeners and listener interfaces; ActionListener and MouseListener

a reading knowledge of basic GUI components and their methods, including:
        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()
        adding event listeners to components; addActionListener, addMouseListener
        basic components:  JButton, JTextField, JLabel
        using getText() and setText() with buttons, textfields, and labels
        adding an ActionListener to a JButton:  button.addActionListener(listener)
        adding a MouseListener to a panel:  panel.addMouseListener(listener)
        panel.setLayout(layoutManager), 
        panel.add(component)  [ for GridLayout or FlowLayout ]
        panel.add(component, BorderLayout.position) [ for BorderLayout ]
        panel.repaint()