Question: Note: Need answer of question 4 both pseudocode and flowchart. Review the below algorithm that uses sequence, selection, and iteration (repetition) to add all the

Note: Need answer of question 4 both pseudocode and flowchart.

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.

No 4. Suppose you had a list of positive numbers such as 5, 10, 12, 13, 6, 7, 1, 3, 2, 1. And suppose for each of the numbers in the list you added the number to a running total if it is even and subtracted it if it is odd, starting the total at 0. What result would you get for this list of numbers?

Write a pseudocode algorithm that implements the algorithm you used to calculate this total.

Create a flowchart that correlates to your pseudocode algorithm. Feel free to use io Links to an external site.to create your flowchart.

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!