QUESTION IMAGE
Question
question: 18 say you want to write a program to have karel put down 300 tennis balls. which control structure would you use? if statement while loop for loop nested while loop
An if - statement is for conditional execution. A while - loop repeats as long as a condition is true. A for - loop is ideal for a fixed number of iterations like putting down 300 tennis balls. A nested while - loop is for more complex repetitive tasks with multiple conditions. Since we know the exact number of times (300) we need to perform an action, a for - loop is the best choice.
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
C. For loop