QUESTION IMAGE
Question
question # 7
dropdown
choose the best type of loop for each situation.
you are finding the batting average of 13 baseball players.
you are asking your users for the names of all the stores where they shopped to find their birthday present. they will show they are done by entering the word \done.\
For finding the batting average of 13 baseball players, a for loop is suitable as you know the exact number of iterations (13 players). For asking users for store names until they enter "done", a while loop is appropriate since the number of iterations is not known in advance and depends on user input.
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
For finding the batting average of 13 baseball players: for loop
For asking users for store names until they enter "done": while loop