CIS 3115
Modern Programming Techniques
Exam #2 Topic List
The Structure of the Exam
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
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.
You are only responsible for topics and material covered in class, the lecture notes, and
the CodeLab exercises / labs. These are a great way for you to prepare yourself for the exam.
The exam is cumulative, but focuses on Lectures/Labs 4-5. Here is a detailed breakdown of the topics
Exception Handling
Throwing, catching exceptions
try/catch blocks
Recursion
Escape clauses
Recursive calls
Recursion on integers, arrays, strings
You should be able to code and read/understand simple recursive methods, including those covered in class, the lecture
notes, and the exercises
Using lower/upper bounds for recursive methods involving arrays and strings
Introducing a wrapper method between the user and the actual recursive 'workhorse' method
int binsrch(int [] arr, int val) {return binsrch(arr, 0, arr.length-1);
int binsrch(int [] arr, int lo, int hi, int val) {…}
Introducing a wrapper method to allow recursion in the context of a class (i.e.
recursing on an instance variable, such as an array)
Fibonacci, binary search, towers of hanoi
You need to be able to write the above methods (pseudocode is fine)