CSCI 2310
Fall 2009
Exercises for Quiz 1

  1. What is a compiler?

    1. A piece of hardware attached to a computer that allows you to run a computer program written in a language such as Java.
    2. Software that translates computer programs written in a language such as Java to another language that can be run on a computer.
    3. An application that helps you write software by letting you cut and paste from different documents.
    Answer

  2. What is the value of Java expression 3 * 3 - 7 * 4 - 9?

    1. 26
    2. 114
    3. -1
    4. -10
    5. -28
    Answer

  3. What is the value of Java expression 5/8?

    1. 0
    2. 0.625
    3. 1
    4. 1.6
    5. 2
    Answer

  4. What is the value of Java expression 20 % 8?

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    Answer

  5. What is the value of Java expression 3 > 5?

    1. true
    2. false
    3. It does not have a value
    Answer

  6. What is the value of Java expression 2 != 4 && 4 >= 2?

    1. true
    2. false
    3. It does not have a value
    Answer

  7. What is the value of m after performing the following statements?

      int m, s;
      s = 50;
      if(s > 25) m = s + 1;
      else m = s - 1;
    
    1. 49
    2. 50
    3. 51
    4. It does not have a value
    Answer

  8. What is the value of m after performing the following statements?

      int m, s;
      s = 50;
      if(s > 25) m = s + 1;
      m = s - 1;
    
    1. 49
    2. 50
    3. 51
    4. It does not have a value
    Answer