0% found this document useful (0 votes)
34 views

Flowcharting Samples

The document contains pseudocode to calculate the sum and average of a series of numbers. It initializes variables to store the running sum, count of numbers, and the current number. It then reads numbers from the user in a loop, adds each number to the sum, increments the count, and exits the loop when the count reaches 5. After the loop, it calculates the average by dividing the sum by the count and prints out the sum and average.

Uploaded by

James Riv Jopia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

Flowcharting Samples

The document contains pseudocode to calculate the sum and average of a series of numbers. It initializes variables to store the running sum, count of numbers, and the current number. It then reads numbers from the user in a loop, adds each number to the sum, increments the count, and exits the loop when the count reaches 5. After the loop, it calculates the average by dividing the sum by the count and prints out the sum and average.

Uploaded by

James Riv Jopia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Start

l = 0,w = 0
Perimeter = 0
Area = 0

Read l and w

Area=l*w

Perimeter=2*l+2*w

Print Area

Print Perimeter

Stop
Start

l=0
w=0
Area = 0

Read l and w

True False
If l==w

Area = l*w Area = l*w

Print Area Print Area

Print Print
“Square” “Rectangle”

Stop
Start

V=0, x=0, y=0,


sum=0, difference=0,
product=0,
quotient=0

Read V, x and y

True False
If V==A

sum = x+y True False


If V==B

difference = x-y True False


If V==C

product = x*y True False


If V==D

Print “Operation
quotient = x/y not recognized”

Print result

Stop
n count a
Start
2 1 2
2 4
3 6
n=0
a=0 4 8
count = 1 5 10
6 12
7 14
Read n 8 16
9 18
10 20

False n count a
count <=10?
5 1 5
2 10
True 3 15
4 20
a = n*count 5 25
6 30
7 35
8 40
9 45
count = count + 1
10 50

n count a
10 1 10
2 20
Print “a”
3 30
4 40
5 50
Stop 6 60
7 70
8 80
9 90
10 100
Start

sum count n
n=0
sum = 0 0 0 3
ave = 0 3 1 7
count = 0
10 2 15
25 3 18
43 4 20
Read n
63 5
ave
12.6

sum = sum + n

sum count n
0 0 1
1 1 5
count = count + 1 6 2 6
12 3 8
20 4 11
21 5
True ave
count < 5?
4.2

False

sum count n
Print “sum”
0 0 2
2 1 5
7 2 6
ave = sum / 5 13 3 8
21 4 12
33 5
ave
Print “ave” 6.6

Stop

You might also like