Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

question 3 you need to write a program where karel will take a ball if …

Question

question 3
you need to write a program where karel will take a ball if there is a ball present, otherwise karel should put down a ball.
which control structure do you need to use?
for loop
while loop
if statement
if/else statement
none of these

Explanation:

Brief Explanations

The task is to perform one action if a condition (ball present) is true and another if false. An if/else statement is used for such conditional - based actions.

Answer:

D. If/Else statement