cs1311 spring 2001 100.0 points due 09:00:00 AM Feb 2, 2001 Please make sure that ALL essays, short answers, definitions, and explanations are in your own words. NO credit will be given for answers taken directly from the book, lecture notes, etc... Turn in this assignment electronically using WebWork NOTE: You may use any module/data type declarations from a previous problem from the same assignment when answering questions. [p1] 15.0 points Consider the following algorithm and report the exact output that will be printed: algorithm ABC_twist fred isoftype Num fred <- 3 wilma isoftype Num wilma <- 3 bambam isoftype Num bambam <- Change( fred, wilma ) print( "fred = ", fred, "; wilma = ", wilma, "; bambam = ", bambam ) untie( fred, wilma, bambam ) print( "fred = ", fred, "; wilma = ", wilma, "; bambam = ", bambam ) untie( fred, wilma, bambam ) print( "fred = ", fred, "; wilma = ", wilma, "; bambam = ", bambam ) endalgorithm // ABC_twist function Change returnsa Num ( x, y isoftype in Num ) if( x > y ) then CHange returns (y - x) else Change returns (x * y) endif endfunction // Change procedure untie( n1, n2 isoftype in/out Num, n3 isoftype in Num ) n3 <- n3 / 3 n1 <- n1 - n2 n2 <- n1 + n3 print( "n1 = ", n1, "; n2 = ", n2, "; n3 = ", n3 ) endprocedure // untie [p2] 15.0 points Write a recursive module that will take in a number N and return the sum of all the odd numbers between N and 0 (inclusively). You may assume that N is non-negative, and that the MOD function exists. [p3] 15.0 points Write a recursive module that will take in a number and print out the even digits in reverse order. You may assume that the number passed in is a positive integer. For example, if the number 56493 is passed to your module, the even numbers from left to right are 6 and 4, so 46 should be displayed to the screen. [p4] 10.0 points Declare a record called Statistics which will hold the following information: - Player Name - Innings pitched - Runs allowed - Unearned runs allowed - Whether the player is eligible to be included in the statistics analysis [p5] 15.0 points Create a module that will fill in a Statistics record as defined in p4. You should prompt the user for each entry and read the answer from the keyboard. The module should return the filled in Statistics record to the calling algorithm or module. Do not prompt the user for eligbility. This should be true if the player has pitched more than 20 innings. [p6] 10.0 points Create a module that will take in a Statistics record defined in p4 and compute a player's earned run average (ERA) where ERA is computed as (runs - unearned) * 9 / innings HINT: - what would cause this module to give an error? - what should it then return? [p7] 10.0 points Write a module that will take in a Statistics record and print out the information in the following form as long as it is eligible: Player: AAAAAAAAAA Innings: XX Earned Runs: XX ERA: XX [p8] 10.0 points Write an algorithm that will use the procedures above to acquire and store the data about three players, and then print out their statistics if eligible.