In this problem you will create your first Java program. Clara is making first steps in her world that initially looks like Figure 1. The task at hand for Clara is to mark her territory with leaves as shown in Figure 2. By continuously moving forward Clara must put one leaf in every second cell, making sure that there is always a gap in the form of an empty cell separating every two leaves. Your program must be written inside method run().

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();
    putLeaf();
    move();
    move();
    putLeaf();
    move();
    move();

🔒 Whatsapp us for the full file.