Question: ------------------------ Note: I know there are answer of this question in chegg but I did not found a proper documented one. So can anyone post

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

Note: I know there are answer of this question in chegg but I did not found a proper documented one. So can anyone post and questions wise

for example

1 ==== ans

2=== ans

3==== ans

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

Review the below algorithm that uses sequence, selection, and iteration (repetition) to add all the even numbers in a list and print out the sum. Notice how indentation and curly brackets are used to clarify the different parts of the algorithm.

 1 total  0 (set total to 0) 2 FOR EACH number IN list 3 { 4 IF(EVEN(number)) 5 { 6 total  total + number (Set total to the current total + number) 7 } 8 } 9 DISPLAY(total) 

This algorithm contains examples of all three types of control structures (sequence, selection, and repetition). The lines are numbered for convenience. For your portfolio project, you will be answering the following questions and creating your own pseudocode algorithm and flowchart.

1. Which line(s) of the algorithm contains a repetition control structure? Remember a control structure can consist of multiple statements.

2. Which line(s) of the algorithm contains a selection control structure?

3. If you run this algorithm on the list of numbers (5, 10, -2, -3, 7, 8, 12), what would it print? When tracing through an algorithm, write down the variables (total and number) and act as if you are the computer executing each line of code and change the values of the variables as needed.

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!