The final exam for this course is scheduled for Tuesday, May 14, at 1:30 PM. It will be held in our regular classroom, Eaton 111. 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.
The last question on the test will be an 18-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, 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 of programming languages 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() the Math.random() function, and using Math.random() to make random integers String methods: str.length(), str.charAt(), str.equals() control statements: if, while, for exceptions and the try..catch statement some common exceptions: NullPointerException, ArrayIndexOutOfBoundsException, IndexOutOfBoundsException, 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 modularity, black boxes, and separation of interface from implementation the access modifiers "public," "private," and "protected" 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 (global) 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" garbage collection ArrayLists; ArrayList types such as ArrayList<String> ArrayList methods: list.size(), list.get(i), list.add(x) using a for loop to process an ArrayList wrapper classes: Integer, Double, etc. extending a class; subclasses and superclasses; inheritance class hierarchies object-oriented programming class Object; every class is a direct or indirect subclass of Object
And here is a list of some of the things covered since the second test:
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 base type of an array elements of an array length of an array index of an element in an 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 partially full arrays; using a counter to keep track of how many elements are used how arrays could be used to implement ArrayLists comparison of arrays, ArrayList, and String two-dimensional arrays using nested for loops to process two-dimensional arrays 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) elements of GUI programming: components, layout, events, graphics 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.setLayout(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() 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 adding a MouseListener to a panel