next up previous
Next: About this document ...

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.
    1. $x = log_4 64 - log_3 9$






    2. $x = 3 ( \frac {2}{6} + \frac {1}{3})$






    3. $4 = log_5 (x^2)$






    4. $x = log_2 12 - log_2 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.




    1. $ x * x^2 - x^2$






    2. $ (x^2 - 2x - 3)(\frac{1}{x+1})$






    3. $ (x + 2)(x^2 - 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));
    



next up previous
Next: About this document ...
Chang Hu 2005-10-06

Web Accessibility