QUESTION IMAGE
Question
question # 4
multiple select
which situations are better suited to an indefinite (while) loop? select 3 options.
writing a program that will average 20 numbers
writing a program to average numbers without requiring the user to count the numbers
allowing the user to enter their best friends names without saying how many friends they can have
writing a program to average the temperatures for the last 30 days
having the user guess a number and keep guessing till they get it right
An indefinite (while) loop is used when the number of iterations is not known in advance. Writing a program to average numbers without user - counting, allowing name entry with unknown quantity, and having user guess until correct all have an unknown number of iterations. Programs averaging a fixed number of items (20 numbers or 30 - day temperatures) are better suited for definite loops.
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
- writing a program to average numbers without requiring the user to count the numbers
- allowing the user to enter their best friends names without saying how many friends they can have
- having the user guess a number and keep guessing till they get it right