Study Guide for CS 312 Test 2 (Summer 2014) * Test 2 will cover material in chapters 1 through 6 and topics in chapter 18 (18.1 - 18.6) on recursion. * There will be no questions on number conversions and operators but you will have to use operators effectively in your answers. * The questions will be of two types - you will either write short pieces of code as methods or you will interpret code and compute the output of the code. * Use if-else or nested if-else in a computation * Use of switch statements - change switch to nested if-else and vice versa * Write loops with while, do-while, and for. Convert one type of loop to another. Write loops to create patterns. Give the output of a loop. * Write methods with their proper signatures (headers) for problems that have input parameters with Strings as well as return Strings. * Use methods that someone has already written, in a method of your own. * Given a recursive method you should be able to tell me what the output will be for a given set of its input parameter(s) and write an iterative version for the method by looking at its output. * These are the methods that you must be familiar with in the Math class: - abs() - sqrt() - pow() - ceil() - floor() - random() * These are the methods in the String class that you should be familiar with: - length() - equals() - equalsIgnoreCase() - compareTo() - charAt() - indexOf() - substring() - split() * These are the methods in the StringBuffer class that you should be familiar with: - append() - insert() - delete() - replace() - reverse() - toString() * You should also be able to open a text file for reading and open a text file for writing. There will be no surprises in the test. It will be strictly based on the topics mentioned in this study guide. The best way to prepare yourself for the test is to write short programs that fulfill the requirements of the bulleted items. Practice using the problems given in LiveLab and Coding Bat.