Week5 Lecture
Draw a flowchart or write pseudocode for these
problems :
1. Search in a list which contents number of items
in stock, this list has 100 elements and find how
many odd and even number of elements in
stock.
CONDITION: IF (NUMBER % 2 = = 0) – Even
Else odd Product ID: Count:
1 62
Start
2 42
3 32
I=1 4 19
No
5 15
6 33
Yes No
If I ≤ 100 ………100 32
Yes
Count % 2 = No Print
=0 Even/odd
Odd + I
Even +1
R=I+1
I = I +1
Stop
Draw a flowchart or write pseudocode for these
problems :
1. Search in a list which contents number of items
in stock, this list has 100 elements and find how
many odd and even number of elements in
stock.
CONDITION: IF (NUMBER % 2 = = 0) – Even
Else odd Product ID: Count:
1 62
Start
2 42
3 32
I=1 4 19
No
5 15
6 33
Yes No
If I ≤ 100 ………100 32
Yes
Count % 2 = No Print
=0 Even/odd
Odd + I
Even +1
R=I+1
I = I +1
Stop