Study Guide for CS 303E Test 2 (Summer 2011) on 23 Jul 2014 * Test 2 will cover material in chapters 1 through 6 and topics in chapter 15 (15.1 - 15.5) on recursion. * There will be no questions on number conversions and operators but you will have touse operators effectively in your answers. * The questions will be of two types - you will either write short pieces of code as functions or you will interpret code and compute the output of the code. * There will be questions on conditionals (if-else). You will either write conditional statements given a set of criteria or you will be given a conditional statements and a set of input values and you should be able to state what the result or output of those conditionals will be. * Loops - while and for * Functions - user defined and built-in * Math Functions * Strings and String Functions * Reading and Writing Text Files * The questions will be similar to quiz questions and the tutorial exercises that you have done on Live Lab and Coding Bat. * Here are some additional String problems that you want to consider. In all cases you will be asked to write a function. - Write a function that accepts a String as input parameter and returns True if it is palindromic and False otherwise - Write a function that accepts two Strings as input parameters and returns True if they are anagrams and False otherwise - Write a function that accepts a String and a rotation parameter and rotates the String by that amount and returns it. For example, given a String "computer" and a rotation parameter of 2, it will return "ercomput". * Here are some file manipulation problems to look at. - Write a function that accepts two Strings - the name of an input file and a target String. It will return the number of occurences of the target String in the file. - Write a function that accepts the name of an input file and a list of forbidden words. If any one of those forbidden words exists in the file it will return False and True otherwise.