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 local ice cream parlor sells an average of 11 milkshakes a day for $3.99
Greeley [361]

In a week, the parlor would make about $300 from milkshakes

The total amount the ice cream parlor makes in a week is dependent is the product of the number of days in a week , the number of milkshakes sold in a day and the price of a milkshake.

Total amount = number of milkshakes sold in a week x price of a milkshake

There are 7 days in a week, in a week the parlor would sell : 11 x 7 = 77 milkshakes

price of a milkshake = $3.99

77 x $3.99 = $307.23

A similar question was solved here: brainly.com/question/14090575?referrer=searchResults

6 0
3 years ago
Hurry! Somebody that’s expert or who knows this pls answer this. MATH WORK.
My name is Ann [436]
50 degrees
180 degrees
130 degrees
130 degrees
5 0
3 years ago
Y is in direct proportion to x. x = 25, y = 5. Find the value of y, if x = 9.​
Sholpan [36]

Answer:bh

345

Step-by-step explanation:

y is in direct proportion to x. x = 25, y = 5. Find the value of y, if x = 9.​

8 0
2 years ago
Read 2 more answers
Under what conditions can a lender repossess a vehicle?
schepotkina [342]
<span>        </span>    

If you fail to make your car payments or otherwise default on your loan, you risk having your car repossessed by your lender.  Read on to learn more about how car repossessions work, how to avoid them, and what your options are if your car gets repossessed.<span>
</span>

5 0
3 years ago
Camillo needs 2,400 oz of jelly for the food challenge. If 48 oz of jelly cost $3.84, how much will Camillo spend on jelly? Expl
pishuonlain [190]

Answer:

She'll spend 192 because 2400 divided by 48 equals 50 times that by 3.84 which will give you 192.

5 0
2 years ago
Read 2 more answers
Other questions:
  • A parabolic satellite dish reflects signals to the dish’s focal point. An antenna designer analyzed signals transmitted to a sat
    5·1 answer
  • If a pork roast must absorb 1700 kj to fully cook, and if only 14% of the heat produced by the barbeque is actually absorbed by
    8·1 answer
  • Write an expression that represents the quantity 5 more than a number
    13·1 answer
  • Cooper invested $510 in an account paying an interest rate of 3 3\8 % compounded daily. Nora invested $510 in an account paying
    7·1 answer
  • 9x+10y=29<br> 10x+9y=28<br> Solve by elimination
    12·1 answer
  • Helppp<br> what r the answers??
    12·1 answer
  • How do you solve -3(2/5x-2)=18
    14·1 answer
  • The answer is b. I didn't see it on here so helping look a picture​
    5·1 answer
  • Which symbol creates a true sentence when x equals 6? 7•6–3x _____ 5(11– x)
    8·1 answer
  • What is the slope of the line graphed below?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!