Name printed Student ID Section or TA s name and time CMSC 250 Quiz 1 Wed August 31 2005 Write all answers legibly in the space provided The number of points possible for each question is indicated in square brackets the total number of points on the quiz is 30 and you will have exactly 10 minutes to complete this quiz You may not use calculators textbooks or any other aids during this quiz You MUST SHOW YOUR WORK for complete credit 1 8 pnts Solve for the numeric value of x in each of the following a x log4 64 log3 9 b x 3 26 13 c 4 log5 x2 d x log2 12 log2 6 2 7 pnts The 0th element of the Fibonacci sequence is 0 The 1st element of the Fibonacci sequence is 1 The nth element of the Fibonacci sequence is defined as the sum of the n 1 th and n 2 th Write a recursive method with signature public int fibonacci int n that will return the nth element of the Fibonacci sequence 3 9 pnts Reduce each of the following to a polynomial in the least number of terms a x x2 x2 1 b x2 2x 3 x 1 c x 2 x2 1 x 4 6 pnts Given the following Java Code public int mystery int n throws Exception System out print n System out print if n 100 return n 10 else return mystery mystery n 11 What is the output of the calling line System out println mystery 97
View Full Document
Unlocking...