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