CS21 Practice QUIZ 4, Swarthmore College Fall 2008 Q1] Start a top-down design for the following problem. Complete at least the main program as well as another function that requires additional sub-functions. Design a program that plays the game Rock-Paper-Scissors. This is a two-player game. Each player simultaneously chooses Rock, Paper, or Scissors. If both players choose the same thing, it's a tie. If not, Paper beats Rock, Rock beats Scissors, and Scissors beats Paper. In your game, have the computer be one player and have a human user be the other player. Play multiple games until the user wants to quit, then report how many times each player won. Q2] Trace through the following program and show the final output of the program. Also draw the stack just before the first call to helper returns. def helper(x, y): z = 0 while x > y: x = x - y z = z + 1 return z def main(): n1 = 18 n2 = 4 ans1 = helper(n1, n2) ans2 = helper(n2, n1) print ans1, ans2 main() Q3] Write a function that, given a file name, opens the file and stores the first character of each line in a list. The function should also close the file when done reading it and return the list of first characters. Show how your function would be called from main. Q4] Write a function that asks the user to enter test scores, and then returns the test scores in a list. The function should continue asking for test scores until the user enters a value of -1.