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
Aliun [14]
4 years ago
14

For the algorithm below, compute the number of multiplications performed, as well as the final value of s. p ← 1 s ← 0 for i is

in {1, 2, 3, 4} do p ← p · 3 s ← s + p number of multiplications final value of s s =
Mathematics
1 answer:
enot [183]4 years ago
5 0
<span>p ← 1

s ← 0

for i is in {1, 2, 3, 4}
      do p ← p · 3
           s ← s + p

n = 1 => first iteration

               p = 1 * 3 = 3
               s = 0 + 3 = 3

number of multiplications ---> 1

n = 2
             p = 3 * 3 = 9
             s = 3 + 9 = 12

number of multiplications ----> 1 + 1 = 2

n = 3
            p = 9 * 3 = 27
            s = 12 + 27 = 39

number o multiplications --> 2 + 1 = 3

n = 4
            p = 27 * 7 = 81
            s = 39 + 81 = 120

final number of multiplications -----> 3 + 1 = 4

final value of s
                     s = 120

Answer: number of mujltiplications: 4
final value of s: s = 120.

</span>
You might be interested in
Has x-intercept of 5 and slope of -2/3
sveta [45]
Crosses x axis at (5,0) and slope -⅔. plug in to point slope formula to get
y=-⅔x-10/3
4 0
3 years ago
What is m&lt;2?<br> What is m&lt;1?
babunello [35]

Answer:

Angle 2 = 75 degrees

Angle 1 = 105 degrees

3 0
3 years ago
Write an expression to show the following:“Fourteen more than the product of nine and a number”
marysya [2.9K]
14(9•x) X would be the variable, aka the number.
4 0
3 years ago
Examine the following diagram:
Tanya [424]

Answer:

b

Step-by-step explanation:

i just took it on edge

5 0
3 years ago
Read 2 more answers
There are 110 calories per 177.4 grams of cereal X. Find how many calories are in 261.5 grams of this cereal
forsale [732]

Answer:

there are 421.728182 calories

Step-by-step explanation:

177.4/110 = 1.61272727

1.61272727 x 261.5 =  421.728182

x= 421.728182

4 0
3 years ago
Other questions:
  • Ach equation:<br> - 5(– 2x - 4) + 5x - 4 =- 29
    13·1 answer
  • If tan 0 = ½ then what is 0 ?
    13·1 answer
  • The price of a new pair of shoes is $52.00. If you order them directly from the company on the internet, you can save money and
    7·1 answer
  • What is the value of x in the equation x – y = 30, when y = 15?
    7·2 answers
  • CAN YOU GUYS PLEASE ANSWER THE QUESTION RIGHT FOR ONCE
    12·2 answers
  • Determine the value of the variable from the image below.
    9·1 answer
  • Find the slope of the line that passes through the points A (-1,5) and B (7,1).
    13·1 answer
  • 10. A random sample of 10 fibers is taken from a collection of 92 fibers that consists of 43 fibers of polymer A, 17 fibers of p
    8·1 answer
  • What polynomial can be factored to give (a + 4) ( a - 4) ?​
    12·1 answer
  • Hello I need help the picture is down below
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!