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
Plz answer :( I need this done by tonight!!!
damaskus [11]

Answer:

40

Step-by-step explanation:

The entire line is 180°

since 140° is occupied, there is a 40° angle.

I hope isn't too late :'(

7 0
3 years ago
Read 2 more answers
Wich is better cats or dogs
kicyunya [14]

Answer:

Dogs

Step-by-step explanation:

They are more active.

6 0
3 years ago
Read 2 more answers
PLS HELP!!!! I NEED TO FIND THE SURFACE AREA OF THIS CYLINDER!!!!!
Hunter-Best [27]
I think the answer is 2990.8 c.m
Hope that helps :)
5 0
3 years ago
At birth bens dad puts $1 in a savings account. Each year on his birthday he goves him double the amount in his account. Write a
jonny [76]

This problem Is an example of geometrica progression. The formula for the sum of geometric progression is:

S = a[(r^n)-1] / (r – 1)

Where s is the sum

a is the first term = 1

r is the common ratio = 2 ( because it doubles every year

n is the number of terms = (19) since the first term is when he was born which he still 0

s = S = 1[(2^19)-1] / (2 – 1)

s = $524,287

<span> </span>

5 0
3 years ago
Find the value for b. 3x^2– X-10 =0<br>​
Greeley [361]

Answer:

3x^2 -(6-5)x-10=0

3x^2 -6x+5x-10=0

3x(x-2)+5(x-2)=0

(x-2) (3x+5) = 0

either,

x -2 =0

x=2

then,

3x +5=0

x= -5/3

3 0
3 years ago
Other questions:
  • The weight of
    14·1 answer
  • 2. A ski resort is building a new ski lift that will transport tourists from the base of the mountain to its highest point. This
    7·1 answer
  • Determine if the equation y = 2/5 x − 4 y=25x-4 represents a proportional relationship. If so, determine the constant of proport
    5·1 answer
  • If all three sides of a triangle have length x, what is the perimeter of the triangle?
    5·1 answer
  • there are 12 girls in Chloe's first grade class. The ration of girls to boys is 6:5. How many boys are in Chloe's class?
    10·1 answer
  • A department store buys 500 shirts at a cost of ​$4000 and sells them at a selling price of ​$10 each. Find the percent markup.
    12·1 answer
  • Mary made 10 3/4 cups of snack mix. Her guests ate 2/3 of the mix. How much snack mix did her guests eat?
    12·2 answers
  • Find the value of x please
    10·1 answer
  • Evaluate.
    13·1 answer
  • karen drove 3/4 of a mile in 1/60 of an hour .At this rate,how many miles would she drive in one hour
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!