QUESTION IMAGE
Question
Question was provided via image upload.
Identify the exercise requirements
The exercise is "3.2.5 Short Stack" in CodeHS Karel programming. The goal of this exercise is to write a program where Karel creates a "short stack" of tennis balls. Specifically, Karel needs to place a stack of 2 tennis balls on the starting spot, move forward one space, and place a stack of 4 tennis balls on the next spot.
Determine the required commands
The available commands on the left sidebar are:
move();putBall();takeBall();turnLeft();
Construct the program sequence
- Place 2 balls on the starting spot:
putBall();putBall();
- Move to the next spot:
move();
- Place 4 balls on the second spot:
putBall();putBall();putBall();putBall();
- Move forward to finish:
move();
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
/* This program has Karel create a short stack of tennis balls.
* Karel places 2 balls on the first spot, moves, and places 4 balls on the second spot. */
putBall();
putBall();
move();
putBall();
putBall();
putBall();
putBall();
move();