S A M P L E Quiz #6 Name ___________________ Honor Code________________________ Section _____ A. Assume we have the following definition of exponentiation (different from what we did in class.): (1) X^N = X * X^(N-1); (2) X^0 = 1 If told X = 3.14 and X^12 = 917662.1 , how would you calculate X^14 using this approach? (Don't do it, just say how to do it.) For recursive use, which of these two lines, (1) or (2) above, would be used to represent the base case? -------------------------------------------------------------------------- For the next two questions, assume that we have a database on computers with the following entries. (These would be stored in 4 arrays.) Assume that you are dealing with a program of the type discussed in the text and covered in the lectures. IBM 32Meg 14" 1.2G Apple 16Meg 17" 1.2G IBM 16Meg 13" 2.2G Apple 8Meg 14" 0.6G IBM 16Meg 17" 1.2G Apple 16Meg 13" 1.2G Sun 32Meg 19" 2.2G B. Assume that the following query was typed into this program: -------- -------- --------- --------- |Apple ||16Meg || ||1.2G | -------- -------- --------- --------- where a blank textfield implies a wild-card entry. What output, if any (write NONE if appropriate) is produced? | -------------------------------------------- C. Assume that the following query was typed into this program: -------- -------- --------- --------- | || ||19" ||1.2G | -------- -------- --------- --------- What output, if any (write NONE if appropriate) is produced? | -------------------------------------------- D. Other possibility: Write function to do SOEMTHING to an array...