Jeroo 6 Weeks Exam

This is quiz. The results are emailed to me when you click on submit.

Instructions: For each question, choose the single best answer. Make your choice by clicking on the circle. You can change your answers at any time. When the quiz is graded, the correct answers will appear in the box after each question.


1.Which statement(s) are true about Jeroo?

    1. Unless otherwise specified, all Jeroos will face EAST by default.
    2. More than one Jeroo can occupy the same locations on the island.
    3. The island can contain more than 1 Jeroo.

A.    1 and 3 
B.   only 1
C.    2 and 3
D.    only 3
E.    1, 2, and 3

2.The maximum number of Jeroos that can be placed on the island is 
A.    1
B.    2
C.    3
D.    4
E.    5

Use the following code to answer questions

while ( bob.hasTelevision(ON) )
   {
        Bob.watches( );
   }

3. In the above code hasTelevision is
 
A.   boolean expression
B.    parameter part
C.    control structure
D.    something Bob can do
E.    none of the above

4. In the above code ON is
 
A.    boolean expression
B.    parameter part
C.    control structure
D.    something Bob can do
E.    none of the above

5. In the above code watches() is
Assume Jeroo Kim = new Jeroo (  ) ;

A.    boolean expression
B.    parameter part
C.    control structure
D.    something Bob can do
E.    none of the above

6. In the above code while is
 
A.    boolean expression
B.    parameter part
C.    control structure
D.    something Bob can do
E.    none of the above

7. Which of the following is a correct parameter for isWater();

A.    AHEAD
B.    Ahead
C.    ahead
D.    none of the above

8. Assume
Jeroo Bob = new Jeroo(  );
Bob.hop(  );
What cell will he be in ?

A.    (1,0)
B.    (1,2)
C.    (2,1)
D.    (0,1)

9. How many Jeroos can be on the island at one time?

A.    2
B.    3
C.    4
D.    as many as you want

Use the following code and picture to answer questions
 
 method main ()
{
Jeroo bob = new Jeroo(2,2);
 while(bob.isClear(LEFT) )
   {
    bob.hop();
   } // end of while loop
} // end of main method

 

10. Will Bob hop?

A.    yes
B.    no

11. If you change the conditional to bob.isWater(LEFT); will Bob hop?
                   
A.    yes
B.    no

Use the following code to answer question


method main()
{
 Jeroo bob = new Jeroo();
  while(bob.isFlower(AHEAD))
    { bob.hop();
    }
}

12.    In the above code isFlower() is a         

A.   parameter part
B.    conditional
C.    boolean expression
D.    something Bob can do

13. What is this code saying in English?

A.    as long as it there is no flower ahead of Bob can keep hopping 
B.    when Bob comes to a flower he should stop hopping
C.    as long as there is a flower in front of Bob he should hop
D.    none of the above

14. In the above code while is a

A.    conditional
B.    parameter part
C.    something Bob can do
D.    none of the above
15. Which statement(s) are false about Jeroos?

    1. Two Jeroo's heading towards each other can pass over each other.
    2. Another Jeroo can occupy the same location on the island after another Jeroo vacates it.
    3. A Jeroo surrounded by water cannot toss a flower to make a passage way out.

A.   only 1
B.    1 and 3
C.    2 and 3
D.    only 3
E.    1, 2 and 3
16.The coordinates for the uppermost left corner of the island where a Jeroo can be placed is
 
A.    (1, 1)
B.    (0, 1)
C.    (0, 0)
D.    (-1, -1)
E.    none of the above
17. a Jeroo is facing WEST at location (5,5) on the island. Which statement(s) will successfully move it to (4,1) and have it facing WEST once there.

    1. name.hop(4);
       name.turn(RIGHT);
       name.hop();
       name.turn(LEFT);

    2. name.turn(RIGHT);
       name.hop();
       name.turn(LEFT);
       name.hop(4);

    3. name.hop(2);
       name.turn(RIGHT);
       name.hop();
       name.(LEFT);
       name.hop(2);
 

A.    1, 2, and 3
B.    1 and 3
C.    2 and 3
D.    1 and 2
E.    only 2

Student Name                 

The number you got right:       Percent Correct:       Letter Grade: