{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

quiz3 - Name Dave's 15-100 Section M N O P February 4 2009...

This preview shows pages 1–3. Sign up to view the full content.

1 Name: ____________________ Section: M N O P Dave's 15-100 February 4, 2009 Quiz 3 Reference Robot void move () //before: front must be clear void turnLeft () void makeLight () //before: must be on dark void makeDark () //before: must be on light boolean frontIsClear () boolean onDark () 1. Consider the following code segment. while (Robot.frontIsClear()) { Robot.turnLeft(); } In each of the following initial states, the robot is initially facing east. For each of these states, circle the direction the robot will be facing after this code segment has executed. If the code never terminates, circle infinite loop . north south east west infinite loop north south east west infinite loop north south east west infinite loop

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2 2. The world is initially in the following state. The following code segment is now executed. while ( ! Robot.onDark()) { while (Robot.frontIsClear()) { Robot.move(); } Robot.turnLeft(); } On the diagram above, clearly mark the robot's final location and direction , after the code segment terminates.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 4

quiz3 - Name Dave's 15-100 Section M N O P February 4 2009...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online