Quiz 2
Directions:
This is an open-note, closed-person quiz, so you may access any notes or lessons on-line. You have until the end of the class period to complete the quiz. When you believe that you are done with the quiz, please raise your hand and I will grade it.
1) Download the world map found here, but DO NOT CHANGE IT.
2) Guido wants to drop off beepers at every corner and dance every time he does.
- First, define a compound instruction that tells Guido to spin. A spin is a complete 360 degree spin.
- You should then define a compound instruction called moveAndDrop where he steps forward once and then checks if the wall in front of him is blocked. If the wall is blocked, Guido should spin, drop a beeper, and then turnleft.
- Your actual program checks if Guido has any beepers, and if he does, then he should moveAndDrop...otherwise Guido is done dropping beepers and should shutdown. You should do the check repeatedly 500 times total. You are NOT allowed to copy and paste code hundreds of times to get the program working.
When your program runs, you should see Guido running to every corner and dropping off a beeper until he is out of beepers.
3) When you are done, raise your hand and be prepared to run your program.
2 pts for "spin"
3 pts for "moveAndDrop"
3 pts for beeper bag check
2 pts for repeating 500 times
----
10 pts total