Clara went for a short stroll. After hours of walking she arrives at the beautiful the meadow, where in the middle stands a big tree, not that different from the tree on the Bag End. It is really hot and Clara desires a bit of shade. Help Clara to come to the tree (Figure 2) from her initial position (Figure 1). Make sure that Clara stands exactly at the specific position. Clara can step on leaves, but she will crash with the tree.

University/Course: WSU

Uploaded: November 2, 2024

Files: 1

✓ Solution:

/* PERMITTED COMMANDS
   move(); turnLeft(); putLeaf(); removeLeaf();
*/
   
class MyClara extends Clara { 
    /**
     * In the ‘run()’ method you can write your program for Clara 
     */
    void run() {
        // TODO: Write your code below
    move();
    turnLeft();
    turnLeft();
    turnLeft();

🔒 Whatsapp us for the full file.