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
A bowl contains 6 red balls, 4 blue balls, 3 white balls and 1 green ball. You pick two balls without replacement. a) What is th
Kay [80]

Answer:

3.5

Step-by-step explanation:

you want to add all of the balls together and then divide by 4 because that's how many color  balls there are

7 0
4 years ago
9(2*2+4➗2)= can you show how to get the answer. Which is 54.
Katen [24]
Here I'll Simplify it to show the work.
You need PEMDAS

9(2*2+4÷2)
9(4+4÷2)
9(8÷2)
9(4)
9(4) = 9 × 4 = 36

The Answer is 36.
6 0
3 years ago
Read 2 more answers
A _____ is the amount you pay for the purchase of a house that decreases the amount of the loan.
tatyana61 [14]
A) down payment .....
4 0
3 years ago
Berry Delicious is a popular shop that sells chocolate-covered strawberries. Last year, the shop used 9,200 kilograms of strawbe
coldgirl [10]

Answer:

15.9%

Step-by-step explanation:

Percent decrease formula =

(Initial value - New value/Initial value) × 100

Initial value = 9200kg

New value = 7739.4kg

Percent decrease = (9200 - 7739.4/9200) × 100

Percent decrease = (1460.6/9200) × 100

Percent decrease = 15.8760869565%

Approximately = 15.9%

The percent of decrease in the amount of strawberries used annually is 15.9%

6 0
3 years ago
If r and s are positive real numbers, which expression is equivalent to
maw [93]

Answer:

The answer is E

I got it right

Step-by-step explanation:

4 0
3 years ago
Other questions:
  • Wo cards are drawn without replacement from standard deck of 52 cards. What is the probability that the first card is a club and
    11·1 answer
  • In general, the value measured by the vertical axis is called the _____ variable.
    10·2 answers
  • Which shows a difference of squares?<br> 1072-4x2<br> 1672 – x2<br> 8x2-40x+25<br> 64x2-48x +9
    10·1 answer
  • Slope is equal to rise divided by one. If you know the horizontal distance (run) in the slope, how can you find the vertical dis
    14·1 answer
  • the equation d=2.5t+4 gives the depth of the snow on the ground during a snowstorm. The variable t stands for the time that has
    15·2 answers
  • The average man takes 7192 steps a day about how many steps does the average man take any year
    8·2 answers
  • I need help understanding this. SO please help and give explanation
    13·1 answer
  • Translate the sentence into an equation.
    6·1 answer
  • Find the rule to complete the pyramid.
    8·1 answer
  • Find the missing probability
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!