Study Guide for CS 303E Test 2 (Summer 2009) * Number Conversions (you may use a calculator) Decimal to binary, octal, hexadecimal and vice versa Binary to octal and hexadecimal and vice versa * Use increment and decrement operators * Know the difference between applying (&& and &) and (|| and |) * Use the bitwise operators (& | ^ ~) in a computation * Use the shift operators (<<, >>, >>>) in a computation * Use the conditional operator ? : * Use truth tables to prove (or disprove) Boolean relations * Use of switch statements - change switch to nested if-else and vice versa * Write methods with their proper signatures (headers) for problems like the following: - a method to determine if a number is prime - a method that reverses a number - a method that determines if a number is palindromic - a method that sums the digits of a number - a method that returns change using the smallest number of coins * 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 methods that you should be able to write using 1-dimensional arrays (look at the Class Work for 13 July 2009 for comprehensive list): - find the max and min elements in the array - search for an element in an unsorted or sorted array - merge two sorted arrays - add two arrays together - multiply corresponding elements in two arrays and return the sum - determine if two arrays are equal - determine if an array is sorted (either in ascending or descending order) - sort an array - return an array that has the cummulative sum of another array * These are methods that you should be able to write using 2-dimensional arrays (look at the Class Work for 15 July 2009 for comprehensive list): - find the max and min elements in the array - search for an element in the array - find the sum of a particular row in the array - find the sum of a particular column in the array - find the sum of any diagonal in the array - find the sum of two 2-dimensional arrays 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.