Question: 1 total 0 ( set total to 0 ) 2 FOR EACH number IN list 3 { 4 IF ( EVEN ( number ) )
total set total to
FOR EACH number IN list
IFEVENnumber
total total number Set total to the current total number
DISPLAYtotalWhich lines of the algorithm contains a repetition control structure? Remember a control structure can consist of multiple statements.
Which lines of the algorithm contains a selection control structure?
If you run this algorithm on the list of numbers 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.
Suppose you had a list of positive numbers such as 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 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
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
