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
Vsevolod [243]
3 years ago
10

EX 6.1 How many iterations will the following for loops execute? for (int i = 0; i < 20; i+ +) { } for (int i = 1; i <= 20

; i+ +) { } for (int i = 5; i < 20; i+ +) { } for (int i = 20; i > 0; i- -) { } for (int i = 1; i < 20; i = i + 2) { } for (int i = 1; i < 20; i *= 2) { }
Mathematics
1 answer:
Romashka-Z-Leto [24]3 years ago
6 0

Answer:

20, 20, 15, 20, 10, and 5 iterations respectively

Step-by-step explanation:

The loop "for (int i = 0; i < 20; i+ +)" starts at i=0 and increases the counter i by 1 at the end of each iteration. The counter must be less than 20, so the values of i in the loop are 0,1,2,3,...,19. These are 20 values, and thus the code iterated 20 times.

The loop "for (int i = 0; i < 20; i+ +)" starts at i=1 and increases the counter i by 1 at the end of each iteration. The counter can't exceed 20, so the values of i in the loop are 1,2,3,4,...,20. These are 20 values, and thus the code iterated 20 times.

Similarly, in "for (int i = 5; i < 20; i+ +)" i takes the 15 values are 5,6,7,...,19. Hence, the code iterated 15 times.

The loop "for (int i = 20; i > 0; i- -)" starts at i=20 and decreases the counter i by 1 at the end of each iteration, so the values of i in the loop are 20,19,18,...,1. These are 20 values, then we have 20 iterations.

The loop "for (int i = 1; i < 20; i = i + 2)" starts at i=1 and increases the counter i by 2 at the end of each iteration. The values of i in the loop are 1,3,5,7,...,19. These are 10 values, and thus the code iterated 10 times.

The loop "for (int i = 0; i < 20; i+ +)" starts at i=1 and multiplies the counter i by 2 at the end of each iteration, so the values of i in the loop are 1,2,4,8,16. Then we have 5 iterations.

You might be interested in
Select the correct answer from each drop-down menu.A carpenter is building a triangular frame. She has three pieces of wood meas
yaroslaw [1]

Explanation

Answer:

The carpenter can build the triangular frame by cutting the 12 foot piece by 2foot

8 0
1 year ago
A and b are complementary angles. a measures 28 degrees. what is the measure of b
elena-s [515]

Answer:

62

Step-by-step explanation:

90 - 28

complementary angles equal to 90

6 0
3 years ago
Read 2 more answers
Ms. Ellis expected 50 families to attend parent teacher conference but 60 families attended. What is the percent error?
natulia [17]

Answer:

20%.

Step-by-step explanation:

That is  (60 - 50) / 50

= 10/50

= 1/5

To convert to a percent we multiply by 100:

= 20%.

6 0
3 years ago
Read 2 more answers
¿Por qué un conjunto numerable es una función biyectiva?????
WITCHER [35]
En matemáticas, un conjunto contable es un conjunto con la misma cardinalidad (número de elementos) que un subconjunto del conjunto de números naturales. Un conjunto contable es un conjunto finito o un conjunto contable infinito.
8 0
3 years ago
According to the WHO report, girls who are 2-years old have a mean head circumference of 47.18cm with a standard deviation of 1.
Verdich [7]

Answer:

1. z = -1.91429

The z score tells us that the head circumference of the girl with the down syndrome ( 44.5 cm) is 1.91429 standard deviations below the mean or average head circumference

2. 2.7792%

Step-by-step explanation:

1. Relative to the WHO data, what is this girls z-score?

z score formula is:

z = (x-μ)/σ, where

x is the raw score = 44.5 cm

μ is the population mean = 47.18cm

σ is the population standard deviation = 1.40cm

z = 44.5 - 47.18/1.40

z = -1.91429

What does the z score tell us?

The z score tells us that the head circumference of the girl with the down syndrome ( 44.5 cm) is 1.91429 standard deviations below the mean or average head circumference

2. Using the WHO data in a normal model, what percentage of the girls has a head circumference that is smaller than the girl with Down's Syndrome?

z score = -1.91429

Probability value from Z-Table:

P(z =-1.91429) = P(x<44.5) = 0.027792

Converting to percentage = 0.027792 × 100

= 2.7792%

6 0
2 years ago
Other questions:
  • in the sequence of numbers a3=0 a4=6 a5=12 a6=18 a7=24 based on this information which equation can be used on the nth term in t
    7·2 answers
  • Match each equation to the situation it represents. Situation Equation An adult and 5 55 children rent skates. It costs $ 4 $4do
    12·1 answer
  • Simply using order of operations <br> 20 - (4*2) ÷ (5-3)
    15·2 answers
  • How do I write the expression using exponents.8⋅w⋅w⋅w⋅w
    11·1 answer
  • A = {prime numbers between 4 and 25}
    10·2 answers
  • What is the greatest common factor of 20 and 50
    10·2 answers
  • Find the value of a and b
    7·1 answer
  • What is the nth term of the linear sequence shown below? -9, -5, -1, 3, 7.
    9·1 answer
  • the aquarium of americas has two new shark tanks. each shark tank holds a total of 1,440 gallons of water. the ratio of sharks t
    10·1 answer
  • 17. Express the shaded part of the picture as a fraction
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!