Question: in python : Set value i to 0. Set value sum to 0. While the value i is less than 4, do the following. Otherwise,

in python :

  1. Set value i to 0.
  2. Set value sum to 0.
  3. While the value i is less than 4, do the following. Otherwise, goto Step 4.
    • a) Ask the user to input a value n.
    • b) Add n to sum.
    • c) Add 1 to i.
    • d) Repeat Step 3 with the updated values.
  4. Output the value of sum.

Create a table tracing the algorithm through each step. Assume the user enters 1, 2, 3, and so on...

table:

Step 4 Repetition

Line #

Comparison

Value of answer

Value of counter

1

#4

#4a

#4b

--

2

#4

#4a

--

#4b

--

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!