1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
mr_godi [17]
3 years ago
6

Choose the best type of loop for each situation.

Computers and Technology
1 answer:
matrenka [14]3 years ago
7 0

Answer:

1. Option A: for loop is correct

2. Option B: while loop is correct

Explanation:

Two loops are used commonly. For and while

For is used when the number of iterations are already known and while is used when number of iterations is not known and the loop has to be terminated based on any condition.

<u>1. You are finding the batting average of 13 baseball players. </u>

For loop will be used as the number of iterations is already known. The score of 13 players has to be used to calculate the average so there will be 13 iterations. Hence, for loop will be used.

<u>2. You are asking your users for the names of all the stores where they shopped to find their friend's birthday  present. They will show they are done by entering the word "done."</u>

While loop will be used as the termination of loop depends on the input given by the user so the number of iterations are not already known.

Hence,

1. Option A: for loop is correct

2. Option B: while loop is correct

You might be interested in
What term best describes the way the dns name space is organized?
Andreyy89
The answer would be hierarchical
 <span />
6 0
3 years ago
Critical observation thinking is best demonstrated by which of the following actions?
yarga [219]

Answer:

Spotting trend in data(apex)

Explanation:

5 0
3 years ago
Read 2 more answers
Which payment type is best if you are trying to stick to a budget?
gavmur [86]
Debit is the best payment type
3 0
3 years ago
This type of technology typically does NOT come with a keyboard or mouse for input.
anyanavicka [17]
The answer is C) tablet. You use the touch screen keyboard for that.
4 0
3 years ago
Read 2 more answers
Who developed the first commercially<br> successful DBMS called Information<br> Management system.
LenaWriter [7]
Charles Bacheman invented the DBMS
3 0
4 years ago
Other questions:
  • What the address for dns server that the eorkstation will use?
    10·1 answer
  • Which of the following statements is not true about the TCP opening and closing of connections?
    6·1 answer
  • Which osi layer defines the functions of logical network-wide addressing and routing?
    14·1 answer
  • Consider the Palindrom class discussed in class. Which of the following is true? It uses one stack and one queue to find out if
    6·1 answer
  • What type of filtering software divides email messages that have been received into two piles, spam and non-spam and then analyz
    13·1 answer
  • How do you change the number of rows and columns displayed for an embedded Excel object on a PowerPoint slide?
    8·1 answer
  • Imagine you were trying to explain the Russian hacking incident to a child (around 10 years of age) and why it was unethical. Cr
    6·1 answer
  • Complete the sentences describing a computer innovation.
    6·1 answer
  • True or False <br> Hebrew Bible and the Koran were first written in English.
    15·1 answer
  • The discipline of building hardware architectures, operating systems, and specialized algorithms for running a program on a clus
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!