I am trying to understand pseudo-code and an assignment that was given and which I have the answer to.(adsbygoogle = window.adsbygoogle || []).push({});

Question:

Write pseudo code for a program that computes the sum of the even numbers from use-provided values. The program will first read the number of values (N) that the user will input. It will then process the N values from user input, one by one. Finally, it will print the sum.

To keep things simple, you can read the next integer and store it in some variable x as follows: x=read

you can print a value x or message as follows: print(x) or print("hello")

-------------------------------------------------------------------------------------------------------------------------------------------------

The answer:

-------------------------------------------------------------------------------------------------------------------------------------------------Code (Text):

START

N = READ

SET I = 0

SET SUM = 0

WHILE I < N

X = READ

IF N%2 IS 0 : SUM = SUM + X

I = I+1

ENDWHILE

PRINT(SUM)

EXIT

I do not understand this. If someone could please explain step-by-step the meaning here it would be greatly appreciated. What does each line represent? why is it there?

**Physics Forums | Science Articles, Homework Help, Discussion**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Understanding of this pseudo-code

Tags:

**Physics Forums | Science Articles, Homework Help, Discussion**