question # 4\nmultiple select\nwhich situations are better suited to an indefinite (while) loop? select 3…

question # 4\nmultiple select\nwhich situations are better suited to an indefinite (while) loop? select 3 options.\nwriting a program that will average 20 numbers\nwriting a program to average numbers without requiring the user to count the numbers\nallowing the user to enter their best friends names without saying how many friends they can have\nwriting a program to average the temperatures for the last 30 days\nhaving the user guess a number and keep guessing till they get it right

question # 4\nmultiple select\nwhich situations are better suited to an indefinite (while) loop? select 3 options.\nwriting a program that will average 20 numbers\nwriting a program to average numbers without requiring the user to count the numbers\nallowing the user to enter their best friends names without saying how many friends they can have\nwriting a program to average the temperatures for the last 30 days\nhaving the user guess a number and keep guessing till they get it right

Answer

Brief Explanations:

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.

Answer:

  • 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