Midterm Exam 1: (revised 9/26/14)
The first midterm is Multiple Choice.
You are responsible for material covered in:
- Lectures
- Textbook readings, see topics below
- Labs: 1 through 5
- Programming assignment 1 and methods part of assignment 2
You do not need to memorize the operator precedence table or the methods
for the Java classes covered. We will provide a reference in the exam for
operator precedence and for select methods for these Java classes:
Math, Scanner, String and Random.
Sample Questions
See the "Content" section (next to "Grades") of the course
Learn@UW page for sample questions.
Topics
"Case Study" sections are not included but may help you to understand how certain programming concepts are used.
- Ch. 1: Introduction
algorithm and pseudocode, IDE, source code -> compiler, class files ->
virtual machine, class and main method, use of braces,
statements, parameters, string, System.out.println and
print, compile-time (syntax) vs. run-time (logic) errors,
exception, debugging and tracing
- Ch. 2: Elementary Programming
declaring and initializing variables, numeric data types (int,
double) and overflow, naming rules and conventions, reserved
words, comments, assignment operator (=) and statement, input
and Scanner class, import statement, defining
constants with final, expression, operator, operand, arithmetic
operators (* / + - integer/ %), operator precedence,
inc/decrement operators (++ --), compound
assignment (+= -= *= /= %=), cast operator, concatentation,
string input with next and nextLine
- Ch. 3: Selections
conditions, boolean type and true/false
values, relational operators (< <= > >= == !=),
if statements (if, if-else, if-else-if forms and flowcharts),
switch statement (including break statement and
default case), boolean variables and operators (!
&& ||), truth tables, == vs. equals,
nested branches, dangling else
problem, short-circuit evaluation,
DeMorgan's Law, input validation (hasNext), test cases (normal,
abnormal, boundaries)
NOT INCLUDED: Section 3.14, Conditional Expressions
- Ch. 4: Mathematical Functions, Characters, and Strings
Math class, String class, String
methods (such as length, charAt, substring),
char type, calling instance vs. calling static methods,
escape sequences (\n \t \\)
- Ch. 5: Loops
repetition idea, repeat while true, infinite loops, off-by-one errors,
while loop, count- vs. event-controlled loop, definite vs.
indefinite loop, for loop, scope of for loop counter,
do loop, post- vs. pre-test loop, user input validation,
sentinel value termination, algorithms (such as summing, average,
counting matches, comparing adjacent values), nested loops
- Ch. 6: Methods
call-execute-return sequence, declaring and calling (static)
methods, parameter passing and pass-by-value (argument values stored
in parameter variables), returning values and return statement,
void methods, call stack tracing, stepwise refinement and
incremental coding, stubs, local variables and variable scope;
- Ch. 7.1-7.7, 7.12: Arrays
declaring and initializing arrays, initial values list and filling
arrays, accessing elements and indexing from 0, length
property, bounds checking and ArrayIndexOutOfBoundsException,
array reference and memory diagrams for arrays, partially-filled arrays,
array algorithms (such as linear search, removing/inserting, printing with Arrays.toString(<type []>), copying
with Arrays.copyOf(), passing arrays to and returning arrays
from methods;
- Random Class
seed, nextInt(), next(), generating random integers for a specified range, class (static) methods,
calling object, Java API.
Midterm Exam 2: (revised 10/29/14)
The second midterm exam is all Multiple Choice and is cumulative in that new topics build
on previous ones. The focus (maybe 3/4) will be specifically on Chapters 7,6, 8, 9 and 10.
Review the topics listed for both midterm exams in addition to those listed
below.
You are also responsible for material covered in:
- Lectures
- Textbook readings, see topics from midterm 1 and below
- Labs: 1 through 10
- Programming assignments 1, 2 and 3 (though we won't expect that you've finished 3)
You do not need to memorize methods for Java's API classes. We'll provide
a reference in the exam for a subset of methods for classes such as String,
Random, and ArrayList.
Sample Questions
See the "Content" section (next to "Grades") of the course
Learn@UW page for sample questions.
Topics
"Case Study" sections are not included but may help you to understand how certain programming concepts are used.
- Ch. 8: Multidimensional Arrays
two-dimensional arrays, passing/returning, 2D arrays with variable row (second dimension) lengths;
- Ch. 9: Objects and Classes
(instantiable) class vs. object (aka instance),
class diagram,
object diagram,
constructors,
creating objects using new,
defining instance methods and declaring instance fields,
default values for instance fields,
interface vs. implementation,
public vs. private,
accessors and mutators,
boolean methods,
overloading,
main (or driver or tester) class,
object references and null,
shared references (aka aliases),
passing/returning references,
calling instance methods,
toString() method,
instance constants,
class (static) constants,
class (static) variables,
class (static) vs instance (non static) methods,
arrays of objects,
partially filled arrays of objects and null,
initiallizing the array vs. the objects in the array,
this reference;
- Ch 10: Object-Oriented Thinking
object-oriented programming (OOP),
encapsulation,
tracing OOP method calls and memory diagrams,
wrapper classes and auto-boxing,
wrapper classes for each primitive (ie. Character class) and named constants,
equals vs. ==;
- Ch. 11.11: ArrayLists
ArrayLists, type parameter for generic class, methods to add/remove/find/size/etc., copying with the
constructor.
Here's a link to a tutorial by Oracle about static vs instance members of Java classes: http://docs.oracle.com/javase/tutorial/java/javaOO/classvars.html
Final Exam: (revised 12/4/14)
The final exam is all Multiple Choice and is cumulative in that new topics build
on previous ones. The focus (maybe 2/3 to 3/4) will be specifically on Chapters 9 through 12 (and 13.6).
Review the topics listed for both midterm exams in addition to those listed
below. You are also responsible for the new material covered in:
- Lectures
- Textbook readings
- Labs: 11 through 14
- Programming assignments 3 and 4
Sample Questions
See the "Content" section (next to "Grades") of the course
Learn@UW page for sample questions.
Topics:
"Case Study" sections are not included but may help you to understand how certain programming concepts are used.
- Ch. 11: Inheritance
inheriting from Object, instanceof operator and casting,
toString and equals, overriding (redefining) inherited methods
- Ch. 12: Exception Handling and Text I/O
text files,
file names - paths (absolute vs. relative) - directories (root vs. current, "." vs. ".."),
import java.io.*,
file output using PrintWriter,
file input using Scanner with File class,
FileNotFoundException and IOException,
close methods,
InputMismatchException,
command line arguments,
exception mechanism and messages,
exception classes and objects,
ArrayIndexOutOfBoundsException and IndexOutOfBoundsException,
NullPointerException,
ArithmeticException,
throwing exceptions (throw statement),
catching exceptions (try-catch statement),
exception handlers,
finally clause,
exception class hierarchy,
checked vs. unchecked exceptions,
checked exceptions and throws clause,
defining your own exceptions with extends clause,
- Ch 13.6: Interfaces
implements clause, Comparable interface, compareTo method