class MyClara extends Clara {
/**
* In the ‘run()’ method you can write your program for Clara
*/
void run() {
// Define the width and height of the cake
int cakeWidth = readInt(“Enter the width of the cake:”);
int cakeHeight = readInt(“Enter the height of the cake:”);
// Building the cake layer by layer
while (cakeHeight > 0) {
// Build the first row of the cake
for (int i = 0; i < cakeWidth; i++) {
placeLeaf();
move();
}
// Move to the next row (from the left side)
turnLeftToStartNextLayer();
cakeHeight–;
// Build the second row of the cake
for (int i = 0; i < cakeWidth; i++) {
placeLeaf();
move();
}
// Move to the next row (from the right side)
turnRightToStartNextLayer();
cakeHeight–;
}
// After building the cake, place candles on top
for (int i = 0; i < 5; i++) {
placeCandle(); // Position and place a candle on the cake
}
}