[an error occurred while processing this directive]
CIS 110

Recitation 1 Exercises (12/13 September 2012)

Before each recitation we will post a short set of written exercises. These are intended to help you prepare for recitation. You must complete them to the best of your ability, and bring them to recitation. Your TAs will note whether you have completed them along with your attendance. These exercises will not be graded for correctness, but you must attempt to answer them and bring your answers to recitation. A portion of your grade depends on your attempting these exercises each week and attending recitation.

Question 1 Indicate your availability for a one-hour midterm at http://www.doodle.com/cmr2495y69h92cph. We need to find a time when as many students as possible from both lecture sections can take the exam.

Have you completed this survery?     YES     NO

Question 2 Briefly describe what happens in Dr. Java if you attempt to compile HelloWorld.java, but omit:

  1. String

  2. println

  3. the ;

  4. the first "

  5. the second {

Question 3 Give the value of a after the execution of each of the following sequences. If you're not sure, you can type the sequence of instructions into the interactions pane in Dr. Java.

    int a = 1;             boolean a = true;      int a = 2;  
    a = a + a;             a = !a;                a = a * a; 
    a = a + a;             a = !a;                a = a * a; 
    a = a + a;             a = !a;                a = a * a; 

Question 4 What do each of the following print? If you're not sure, you can type them into the interactions pane in Dr. Java.

  1. System.out.println(2 + "bc");

  2. System.out.println(2 + 3 + "bc");

  3. System.out.println((2+3) + "bc");

  4. System.out.println("bc" + (2+3));

  5. System.out.println("bc" + 2 + 3);