8.10. Check Yourself

    Q-1: How large would the undo queue be for the above code example?

  • 13
  • No, think about how many times fill is used...
  • 10
  • Correct!
  • 8
  • Incorrect! Consider that almost everything a turtle does is an action, even filling.
  • 4
  • Incorrect! Consider that there are some actions in a for loop.
#include <CTurtle.hpp>
namespace ct = cturtle;

int main() {
    ct::TurtleScreen scr;
    ct::Turtle turtle(scr);

    for(int i = 0; i < 5; i++){
        turtle.forward(50);
        turtle.right(144);
    }

    scr.bye();
    return 0;
}

    Q-2: What kind of shape does the above activecode create?

  • Circle
  • Incorrect! Consider how many times the for-loop iterates...
  • No shape
  • Incorrect! The turtle's pen is always down.
  • Pentagon
  • Incorrect! Consider the angle the turtle turns every iteration.
  • Star
  • Correct!

    Q-3: You can have more than one turtle on one screen.

  • True
  • Correct!
  • False
  • Incorrect!
You have attempted of activities on this page