ALGORITHM 1: CALCULATION OF AVERAGE OF THREE NUMBERS (CONSTANTS)

Step 1: Determine sum of 50, 34, and 23

Step 2: Divide sum by 3 to obtain average

Step 3: Display average

Step 4: Stop


ALGORITHM 2: CALCULATION OF AVERAGE OF ANY THREE NUMBERS (VARIABLES)

Step 1: Obtain Number1, Number2, and Number3

Step 2: Add Number1, Number2, and Number3 to determine Sum

Step 3: Divide Sum by 3 to determine Average

Step 4: Display Average

Step 5: Stop


ALGORITHM 3: CALCULATION OF SUM OF A SET OF NUMBERS

Step 1: Initialize Sum to 0

Step 2: Obtain a number, say X

Step 3: Repeat following steps while X is a valid number i.e.

while set is not empty

Step 3.1: Add X to Sum

Step 3.2: Obtain next number X

Step 4: Display Sum

Step 5: Stop


ALGORITHM 4: CALCULATION OF AVERAGE OF A SET OF NUMBERS

Step 1: Initialize Sum to 0

Step 2: Initialize Count to 0

Step 3: Obtain a number X

Step 4: Repeat the following steps while set is not empty

Step 4.1: Add X to Sum

Step 4.2: Add 1 to Count

Step 4.3: Obtain next number X

Step 5: If Count is not 0, then

Step 5.1: Divide Sum by Count to determine Average

Step 5.2: Display Average

Step 6: Stop


ALGORITHM 5: CALCULATION OF AVERAGE AGE OF TEENAGERS IN A GROUP OF PEOPLE

Step 1: Initialize Sum to 0

Step 2: Initialize TeenCount to 0

Step 3: Obtain an Age

Step 4: Repeat the following while a person's age is found

Step 4.1: If Age is between 13 and 19, then

Step 4.1.1: Add Age to Sum

Step 4.1.2: Add 1 to TeenCount

Step 4.2: Obtain next Age

Step 5: If TeenCount is not 0, then

Step 5.1: Divide Sum by TeenCount to determine Average Age

Step 5.2: Display Average Age

Step 6: Stop