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
I have just one question, could someone please answer it?? (see linked file)
Annette [7]

The solution is x=1 and y=-2

Further explanation:

Given equations are:

\frac{7}{2}x-\frac{1}{2}y=\frac{9}{2}\\3x-y=5

Multiplying equation no. 1 with 2 will give us:

7x-y=9       Eqn 3

From equation no 2:

3x-y=5\\-y=5-3x\\y=3x-5

Putting the value of y in eqn 3

7x-(3x-5)=9\\7x-3x+5=9\\4x=9-5\\4x=4\\\frac{4x}{4}=\frac{4}{4}\\x=1\\Putting\ x=1\ in\ equation\ 2\\3(1)-y=5\\3-y=5\\-y=5-3\\-y=2\\y=-2\\

The solution is x=1 and y=-2

Keywords: Linear equations, Solution set

Learn more about linear equations at:

  • brainly.com/question/561665
  • brainly.com/question/537998

#LearnwithBrainly

8 0
3 years ago
The graph shows the speed of a ball in free fall for 10 seconds. Which is the constant of proportionality shown in the graph? It
Tresset [83]

Answer:A

Step-by-step explanation:

8 0
3 years ago
Whats the value of x?
Nutka1998 [239]

Answer:

x = 8 units, measure of angle AFE = 60 degrees, measure of angle CFD = 60 degrees

Step-by-step explanation:

Finding x:

You know all three of the given measures add up to 180 because they are on the same side of the line. Write an equation and solve for x.

6x + 2 + 8x + 6 + 7x + 4 = 180

21x = 168 --> x = 8

Angle AFE:

Substitute the value of x in the given measure.

7x + 4 = 7*8 + 4 = 56 + 4 = 60

Measure of angle CFD:

Angle AFE is it's vertical angle, so their measures (60 degrees) are equal.

7 0
3 years ago
Confused on this part
Andre45 [30]

Answer:

The first 2 and the last one

Step-by-step explanation:

You need to have an input per output, and to choose one or multiple the need to have a continuous pattern. Ex.+5 ad -2 on both sides every time would be a linear function.  

6 0
2 years ago
What is the result when the number 35 is increased by 20%?<br> Show me your work!
nirvana33 [79]

Answer:

42

Step-by-step explanation:

first we calculate what is 20% of 35 is then we add it to 35 to find the increased number

35 ÷ 100 = 0.35 this multipled by 20 = 7

35 + 7 = 42

3 0
3 years ago
Other questions:
  • Write the augmented matrix for each system of equations.
    10·1 answer
  • What is the best estimate for the answer to 321.786 + 240.273?
    12·1 answer
  • AAAAAAAAAAAAAAAAAA Help please ;-;​
    12·1 answer
  • Which value is a solution of the equation 2 – 8x = –6?
    11·1 answer
  • The weight of an object on Mars is about 2/5 its weight on Earth. How much would an 80 1/2 pound dog weight on Mars?
    6·1 answer
  • Which could be the degree of the function represented by the graph?
    13·1 answer
  • Can somebody please help me with number 2 and 5 its done today i will give brainliest
    12·1 answer
  • Hello Good morning can someone give me the answer of this operation?
    9·1 answer
  • Mohamed packs food in a cooler for a camping trip. He makes
    5·1 answer
  • Geometry.... ://...<br><br>​help please!
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!