Midterm Exam 1:
Very Important Notes:
- It is closed book
- No calculators, or computing devices of any sort(iPad, laptops etc.)
- Make sure you have at least a vacant seat to your left AND right during exam
- Bring your UW ID, it'll be collected before you can take the exam and be returned after you submit your exam.
The exam is voided if you take it without submitting your UW ID.
You are responsible for material covered in:
- Lectures
- Textbook readings, see topics below
- Programming assignment 1
You need to memorize the common operator precedence && the common methods
for the Java classes covered in lectures PPT slides, especially those methods in the following Java classes:
Math, Scanner, String and Random. Methods or classes not covered in slides
will be provided in a reference sheet.
Midterm 1 will consist of both multiple choice and written questions.
Sample Questions
Click on Sample Questions to get a feel what the format is for multiple questions.
As for the written part, it's gonna be very similar to what you saw in HWs 1&&2.
Topics:
"Random Fact" sections are not included.
- 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: Fundamental Data Types
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 (++ --), Math class, compound
assignment (+= -= *= /= %=), cast operator, String
class, concatenation, string input with next and
nextLine, escape sequences (\n \t \\), String
methods (such as length, charAt, substring),
char type, calling instance vs. calling static methods;
NOT INCLUDED: 2.5.5 Formatted Output and Special Topic 2.1
- Ch. 3: Decisions
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, lazy evaluation,
DeMorgan's Law, input validation (hasNext), test cases (normal,
abnormal, boundaries)
NOT INCLUDED: Special Topics 3.1-3.2
- Ch. 4: 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. 5: 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;
NOT INCLUDED: 5.8 Recursive Methods
- Ch. 6.1 - 6.4: Arrays and Array Lists
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, copying
with Arrays.copyOf(), passing arrays to and returning arrays
from methods;
NOT INCLUDED: 6.2 The Enhanced for Loop, 6.5 Two-Dimensional
Arrays, 6.6 Array Lists, and Special Topics 6.1-6.3
- Random Class
seed, nextInt(), generating random integers for a specified range
Midterm Exam 2:
Very Important Notes:
- It is closed book
- No calculators, or computing devices of any sort(iPad, laptops etc.)
- Make sure you have at least a vacant seat to your left AND right during exam
- Bring your UW ID, it'll be collected before you can take the exam and be returned after you submit your exam.
The exam is voided if you take it without submitting your UW ID.
You are responsible for material covered in:
- Lectures
- Textbook readings, see topics below
- Programming assignments 1, 2
In addition to the methods you memorized for java classes covered in Midterm 1,
you need to know how to use methods for Arrays and ArrayList in PPT slides.
Topics
"Random Fact" sections in the textbook are not included.
- Ch. 6.5 - 6.6+: Arrays and Array Lists
two-dimensional arrays,
ArrayLists, type parameter for generic class, wrapper classes
and auto-boxing, methods to add/remove/find/size/etc., copying with the
constructor, passing/returning, plus: arrays of objects,
partially filled arrays of objects and null, initializing the
array vs. the objects in the array;
NOT INCLUDED: 6.6.2 Using the Enhanced for Loop
- Ch. 7: Objects and Classes
object-oriented programming (OOP), (instantiable) class vs. object (aka
instance), creating objects using new, instance methods and
instance variables, default values for instance variables, interface
vs. implementation, public vs. private, encapsulation,
accessors and mutators, boolean methods, constructors, overloading,
driver (tester) class, object references and null, shared
references (aka aliases), passing/returning references, this
reference, calling instance methods, tracing OOP method calls and
memory diagrams, equals vs. ==, toString()
method, instance constants, class (static) constants, class
(static) variables, class (static) methods, packages
Final Exam:
The final exam is cumulative in two respects: new topics build
on previous ones and, while the written part of final exam emphasizes the
material since the second exam, the multiple choice part will be cumulative.
Review the topics listed for both midterm exams in addition to those listed
below. More details will be revealed when final exam date is approaching.