Midterm Review Guide

The midterm exam is open book, but not open notes. You may bring one page (both sides) of notes. Bring a calculator if you want one for the program trace computations.

Terms and Concepts

Java source code, compiling, Java byte code, class, object, instance variable (data member), method (procedure), event, constant (numeric, character, string, boolean), variable (name, value, address, size, range), primitive datatype (int, double, char, boolean), operators (arithmetic, comparison, logical, assignment, string concatenation), structured progamming (sequence, repetition (while and for loops), decision (if..else)), static methods, object methods, constructor.

Predefined Classes

VendingMachine, String, Coin, JOptionPane, Math, Applet, Color, Graphics.

Predefined Object

System.out.

Be Able To

  1. Answer short answer, True/False, or multiple choice questions. You will need to give reasons to support your answer for True/False or multiple choice questions.

  2. Construct the program trace and predict the output of a Java program.

  3. Use the predefined classes to create objects and use their methods (static or nonstatic).

  4. Write a Java program that will input a single case, do a computation, and print the answer. This might involve string processing.

Possible String Processing Problems

  1. count the number of characters of a certain type in a string,

  2. check for the existence of a character of a certain type,

  3. check that all characters in a string are of a certain type.