To Exam Info
CSC 212 -- Review Guide for Midterm
To Bring to Midterm
- Two pages (8 1/2 x 11) of notes both sides.
Read in Text Book:
- Skim chapters 4 and 5 if you want a review of if statements
and loops.
- Read chapters 8, 9, 10. Appendix D, pp. 969 - 972
To Study for Midterm:
- Review questions at the beginning of lectures.
- Your submissions for projects and lab exercises.
- Examples discussed in class.
Terms and Concepts
- Datatypes (byte, short, int, long, float, double, char, boolean).
- Decimal, hex, and binary representations of signed byte values (8 bits).
- Twos Complement notation for representing signed binary numbers.
- Logical Operators (&& ||, &, |, ^, !).
- Short circuit evaluation, complete evaluation.
- Bitwise Operators (&, |, ^, !, ~).
- Bitwise operators for manipulating the bits in a bitmask
(| sets bits to 1, & sets bits to 0, ^ toggles bits.)
- if..else, while, for, do, switch statements.
- Conversion methods (Integer.parseInt, Double.parseDouble,
String.valueOf).
- UML diagrams (Class name, instance variables, methods).
+ means public, - means private.
- Writing classes (instance variables, constructors, methods,
getters, setters, toString, equals, compareTo)
- Classes vs. objects.
- Reference variable declaration vs. object instantiation.
- Camel casing vs. Pascal casing.
- Types of variables (instance, local, parameter (formal parameter),
argument (actual parameter), return value, primitive, reference).
- Current object (this).
- Overloaded constructor, overloaded method, signature.
- Accessibility modifier (public, private).
- Arrays of objects (declaration, memory allocation, array index,
array value, inserting an object, referencing an object).
- Stacks.
- Reading from the keyboard, reading from a hard drive file.
Builtin Java Classes
- String Methods:
charAt, compareTo, equals, indexOf, lastIndexOf, length,
toString, replace, substring,
toUpperCase, toLowerCase, valueOf.
- StringBuffer Methods:
append, capacity, charAt, delete, insert, length, replace, reverse,
setCharAt, setLength.
- StringTokenizer Methods:
nextToken, hasMoreTokens.
- Character Static Methods:
isDigit, isLetter, isLetterOrDigit, isLowerCase, isUpperCase,
isWhiteSpace, toLowerCase, toUpperCase.
- Scanner Methods:
hasNext, hasNextBoolean, hasNextDouble, hasNextInt, hasNextLine,
next, nextBoolean, nextDouble, nextInt, nextLine.
Be Able To:
- Respond to short answer or short essay questions.
- Predict the output of a Java program that performs
bitwise operations.
- Predict the output of a Java program in general.
- Write Java code to solve a problem.
- Given a class draw its UML diagram.
- Given a UML class diagram, write Java code to implement a class. Be
able to write these methods or types of methods for a class:
constructor, getters, setters, toString, equals, compareTo
- Write Java code to test or otherwise use a class.
- Given Java code, find as many compile-time and run-time errors
as you can.
- Given an array, search the array to find objects that satisfy
constraints.
- Given an array, construct the trace for applying the InsertionSort
algorithm.
- Given an array, construct the trace for applying the SelectionSort
algorithm.
- Write JavaScript code for reading from or writing to a hard disk file.