Review for Exams
Table of Content
Acknowledgement
This review guide is adopted from Professor Gerald Weiss and Professor Ira Rudowsky and CISC 1115 instructional team with revision.
Structure of Exams
- For all topics, you should be able to trace, analyze, and write Java code.
- Questions will for the most part consist of,
- presenting you with a piece of code and asking you what is output — or what the value of one or more variables are — once the code is executed
- presenting you with a problem description and asking you to write the corresponding code
- asking you what is wrong with a piece of code and/or asking you to repair it
- presenting you with a piece of code and asking you to trace the value of one or more variables as the code is executed
- There may also be some multiple-choice and short answer questions.
- Questions will for the most part consist of,
- Although you will not be asked for definitions of terms, you should know them as they will be used in the text of the questions.
- While the book is a good supplement, you are only responsible for topics and material in the lecture notes and the various exercises and assignments. These are a great way for you to prepare yourself for the exam.
Topics in CISC 1115.
- Arithmetic calculations
- Strings and Boolean and logical operations
- Static methods
- Method overloading
- Control structures
- Branching (if, if-else, if-else if-else, and nested)
- Loops/iterations (for loop, while loop, do-while loop)
- Application of loops: Input loops (with Scanner)
- Nested loops
- Arrays
- Basics
- Traversals
- Array-array operations (see algorithms)
- Searching (see algorithms)
- Sorting (see algorithms)
- Files
- Using Java API documentations
- Numerical Algorithms
- Absolute value; Toggling: 0<-->1 and -1<-->1; parity; divisibility; primality)
- Square root finding (binary search and Newton's algorithm)
- Histogram construction
- Logical Algorithms
- Toggling true <--> false
- String Algorithms
- Forming initials from String variables or an array, variations on separator
- picking out tokens from whitespace
- finding the nth word in a String
- Counting substrings
- Replacement
- Data input algorithms
- Organized data with header (count prefix)
- End of data (e.g., using sentinel, i.e., trailing token)
- Nested input sequences (either header or sentinel based)
- Ordered Type Algorithms (numerical and String), e.g.,
- Maximum (minimum) of two
- Maximum (minimum) of three
- Checking for ascending (descending) order of two
- Checking for ascending (descending) order of three
- Sequence of Input and Array/ArrayList Traversal Algorithms
- Counting items having a common property
- Accumulations. addition, multiplication, conjunction, disjunction
- Checking for ascending (descending)
- Finding extremes (maximum, minimum)
- Determination of all/some/none of the items having a common property
- Adjacency algorithms
- identifying runs (e.g., of consecutive numbers)
- counting or eliminating duplicates
- Single array modification
- Element shifting
- Reversing elements
- Frequency counts
- Multiple array algorithms
- element-to-element arithmetic, comparison, string operations
- copying, selecting
- Sorting and Searching
- Selection sort
- Sequential search
- Binary search
Topics in CISC 3115. Part I
- Programming environment
- Java language idiom
- Defining classes
- Data fields (variables; instance vs. class variables)
- Behavior (methods; instance vs. class methods)
- Constructors (default constructor, parameterized contructors)
- Defining instance methods
- Calling instance methods
- objects, reference variables vs primitive type variables
- Arrays of objects
- Passing object arguments to methods
- Returning objects
- The
this
reference variable - Computer basics (Stack vs. heap)
- Relationship among objects
- Client-server model
- Message-passing model
- Relationship among classes
- Association (also, composition & aggregation)
- Realizing association relationship in Java programs
- Inheritance (more ...)
- Inheritance
- Constructors (default constructor, parameterized constructor, constructor chaining, the
super
keyword) - Realizing inheritance in Java programs
- Method overriding
- Polymorphism and dynamic binding
- Writing generic methods
- Constructors (default constructor, parameterized constructor, constructor chaining, the
- Designing larger programs
- Packages and modifiers (package, visibility modifier and access control, the
final
modifier) - UML diagrams (class diagrams, sequence diagrams)
- Types of application. Text-based interface (menu-driven interface) programs
- Types of application. Command line interface programs
- Types of application. Utility programs (no prompts, using stdout & stderr for output & error)
- Types of application. Multi-file/multi-class programs
- Java API classes CISC 1115.
String
, PrintStream, Scanner, File, Math; CISC 3115. ArrayList, Object, Wrappers, Date, Random, Point2D) - Dealing with compilation errors; tracing programs
- Development process. Design, implementation, Testing
- Packages and modifiers (package, visibility modifier and access control, the
- Algorithms
- CISC 1115. those discussed in CISC 1115
Topics in CISC 3115. Part II
- Handling errors and exceptions
- contrasting two primary methods to handle errors and exceptions
- try-catch blocks
- try-with-resources blocks
- throwing exceptions and rethrowing exceptions
- declaring methods to throw exceptions
- checked vs. unchecked exceptions
- understanding and using stack traces for debugging
- defining and using customer exception types
- the Throwable type hierarchy and polymorphism
- Text (Character) File I/O and Exceptions
- Locating files and directories using their file system path
- Relative path vs. absolute path
- Concept of text (character) file
- Using the File class
- Using the Scanner class to read text files
- Using the PrintWriter class to write to text files
- Using try-catch-blocks and try-with-resources-blocks with files
- Handling exceptions while working with files
- Using the finally clause to do clea-up or to release resources
- Abstract class
- Defining and using abstract method
- Defining and using abstract class
- Designing generic methods using abstract classes and methods
- Interface
- Defining interface
- Implementing interface
- Designing type hierarchies using interfaces, abstract classes, and concrete classes
- Designing generic methods using interfaces
- The Comparable, Comparator, and Cloneable interfaces
- Using the Comparable and Comparator interfaces for sorting and searching
- Recursion
- Understanding the concept of recursion
- Designing for mathematical recursive functions
- Using recursive helper methods
- Using recursion for problem solving including sorting, searching, file system traverse, and string operations.
- Java Collection and Map API
- Understanding the concept of Collection and List
- Contrasting Collection, and List
- Contrasting ArrayList and LinkedList
- Sorting and searching using lists
- Understanding Set
- Contrasting HashSet, LinkedHashSet, and TreeSet
- Contrating Set and List
- Understanding Map
- Contrasting HashMap, LinkedHashMap, and TreeMap