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
Lelechka [254]
3 years ago
15

A. Consider the following algorithm segment: for i := 1 to 4, for j := 1 to i, [Statements in body of inner loop. None contain b

ranching statements that lead outside the loop.] next j, next i. How many times will the inner loop be iterated when the algorithm is implemented and run?
b. Let n be a positive integer, and consider the following algorithm segment: for i := 1 to n, for j := 1 to i, [Statements in body of inner loop. None contain branching statements that lead outside the loop.], next j, next i. How many times will the inner loop be iterated when the algorithm is implemented and run?
Mathematics
1 answer:
yuradex [85]3 years ago
6 0

Answer:

(a) 4i times

(b) "i × n" times

Step-by-step explanation:

(a) Given the algorithm segment;

       for i := 1 to 4,  (Outer loop)

            for j := 1 to i   (Inner loop)

            next j,

       next i

The inner loop runs for i times, while the outer loop runs for 4 times.

The total times the inner loop would run when the entire algorithm is run is:

      = i × 4

      = 4i times

(b) Given the algorithm segment;

     for i := 1 to n,  (Outer loop)

            for j := 1 to i   (Inner loop)

            next j,

      next i

Where n is a set of positive integers.

The inner loop runs for "i" times, while the outer loop runs for "n" times.

The total times the inner loop would run when the entire algorithm is run is:

      = i × n

      = "i × n" times

You might be interested in
The answer for this problem
saveliy_v [14]

Answer:

  \textbf{C}\quad\dfrac{13}{20}=\dfrac{25}{40} \qquad\textbf{FALSE}

Step-by-step explanation:

Each of the equations represents equivalent fractions except the one in choice C.

  13/20 = 26/40, not 25/40.

_____

<em>Comment on equal sign</em>

IMO, one should never use an equal sign where things are not equal--unless there is a clear indication you understand they are not equal. The equal sign should be regarded as a sacred symbol, with very specific rules as to its meaning and use.

3 0
3 years ago
Work out m and c for the line: y = x + 4
OLEGan [10]

Answer:

Step-by-step explanation:

6 0
4 years ago
Find the area of the composite figure
-BARSIC- [3]

Answer:

48 ft^2

Step-by-step explanation:

5.5 times 6 equals 33 (larger square part)

2.5 times 6 equals 15 (two triangles combined so you dont have to 1/2)

4 0
3 years ago
A charity gala is held in a hotel ballroom each year. The cost is $150 for the ballroom and an
Serga [27]

Answer: x=100$

Step-by-step explanation:

use the slope formula

y=mx+b

plug in what you have

y=2400, m=22.50x, b=150

solve for x

2400=22.50x+150

subtract 150 from both sides

2250=22.50x

divide 22.50 x from both sides

x=100 people

don't forget your units :)

5 0
3 years ago
HELP PLS NEED THIS IN 5 MIN
swat32

Answer:

0.25

Step-by-step explanation:

1. Add up all of the students.

20+20+25+7+13+5+3+2+5=100

2. Make a ratio of that number and the number of all the students in Music/Drama

MUSIC/DRAMA: 7+13+5=25

\frac{25}{100}

3. Simplify

\frac{25}{100} = \frac{5}{20} =\frac{1}{4} = 0.25

8 0
3 years ago
Other questions:
  • 6+8x2=5x<br><br> A. –2<br><br> B. –1<br><br> C. 1/3<br><br> D. \(3\)
    14·1 answer
  • Which Expression does not name an interger? a. -15 b. 6/14 c. 0 d. 12/6
    13·1 answer
  • How to solve 5/8h = 1,1/2=5
    5·1 answer
  • The vertex of this parabola is at (2,-4). When the y-value is -3 and the x-value is -3. What is the coefficient of the squared e
    7·1 answer
  • What is the answer to:<br> x + y = 4<br> Y= x+4<br> Using elimination
    14·1 answer
  • HELPPP IM PANICKINGGGG
    5·1 answer
  • I dont have that much time <br>witch one is it<br>A<br>B<br>C<br>D ​
    12·2 answers
  • 4. The area of a triangle measures 54 in2. The height of the triangle is 18 inches. What is the base of the triangle?
    9·1 answer
  • What is the equation of the graph
    6·2 answers
  • Graph y &lt; - 4/3x + 3
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!