You are on page 1of 2

Mary Austine P.

Bonifacio August 16,


2010

I- St. Aquinas

Take Home Activity

Directions: Write the PSEUDO CODE and FLOWCHART of the following.

1. A program that will output the sum and average of 5 numbers namely X1, X2, X3, X4, and X5.
Your program will accept zero and negative numbers.

PSEUDO CODE

Output the sum and average of 5 numbers using addition

1. Start

2. Input X1, X2, X3, X4, X5


3. Initialize the sum (s) to zero
4. Add the value of s and X1, X2, X3, X4, and X5 (and equate the sum)
5. Compute S = s x X1, X2, X3, X4, X5
6. Output Product
7. End

FLOWCHART
START

Input X1, X2, X3, X4, X5

S=0

S = s x X1, X2, X3, X4, X5 X1, X2,


X3, X4, X5
Output s

End

2. Calculate the area of trapezoid given the formula:

Area = ( BASE 1 + BASE 2)


(HEIGHT)
2

PSEUDE CODE

Calculating the Area of Trapezoid

1. Start
2. Input the base of a trapezoid and call it BASE.
3. Check if BASE is negative or zero, if so go back to step 2, otherwise.
4. Input the height of a trapezoid and call it HEIGHT.
5. Check if HEIGHT is negative or zero, if so go back to step 4, otherwise.

6. Compute AREA = ( BASE 1 + BASE 2)

2 (HEIGHT)

7. Output Area
8. End

FLOWCHART
START

Input base

AREA = ( BASE 1 + BASE 2) (HEIGHT)


If BASE > 0 False 2

True Output Area

Input height

End

If HEIGHT > 0 False

True

You might also like