Study Guide for CS 303E Test 2 on 29 Mar 2017 * The material for the test will cover chapters 2, 3, 4, 5, 6, 8, 10, 13.2 * Conditionals: if-elif-else * Loops - while and for. Use of break and continue. * Functions - user defined and built-in * Math Functions * Random Functions * Strings and String Functions * Reading and Writing Text Files * 1-D Lists * Algorithms - max, min, sum, sequential search, binary search * The questions will be similar to quiz questions and the tutorial exercises that you have done on Live Lab and Coding Bat and simpler versions of your assignment problems. * From the Python section of Coding Bat do - String-1, String-2, Logic-1, Logic-2, List-1, and List-2. * From the Java section of Coding Bat do - String-2, String-3, Array-2, and Array-3. * 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 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". - Write a function that returns True if two Strings are anagrams * 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. * Here are some list problems to look at: - Write a function that takes as input two 1-D list of the same size and returns a single number that is the sum of the corresponding products of the elements of the two lists. a = [1, 2, 3] b = [4, 5, 6] Your function should return 1*4 + 2*5 + 3*6 = 32 - Write a function that takes as input a 1-D list and returns True if it is sorted in ascending order and False otherwise. - Given a 1-D list of 3 numbers sort the list in ascending order without using the built-in sort function or loops. - Given a 1-D list shuffle the contents of the list. - Given a 1-D list return another 1-D list that contain only the unique elements of the first list (remove duplicates)