You must complete Program Development to unlock this Lesson.

# ALGORITHMS AND FLOWCHART

CONTENT

1. Writing an Algorithm
2. Flowchart Symbols and their Uses
3. Use of Flowchart
4. Flowchart Diagrams for Solving a Given Program

## Writing an Algorithm

Example 1: Compute the average of a given set of numbers, N

Solution:

(i) Input “count the numbers in the set”: N

(ii) C = 1// used to count the numbers processed

(iii) Sum = 0

(iv) If c>N :go to line 9

(v) Input next number; num

(vi) Sum=sum + num

(vii) C = c + 1

(viii) Go to line 4

(ix) Average = sum/Nn

(x) Write the value of average

(xi) Stop

Example 2: Evaluate the equation y = a (b-c)2/d+2

Solution:

(i) Input values for a, b, c, d

(ii) Y = a*(b-c)^2/(d+2)

(iii) Write the value of y

Example 3: Print out the first ten odd numbers

Solution:

(i) C = 1  //use to count the numbers processed

(ii) Sum = 0 //use to sum of number

(iii) Odd = 1  // first odd number

(iv) Sum = Sum+odd

(v) Odd = odd+2

(vi) C = C+1

(vii) If C>10; go to line 9

(viii) GOTO 5

(ix) Print odd

(x) Stop

EVALUATION

1. Write a pseudo-code for printing out the first fifteen even numbers

## Flowchart Symbols and their Uses

A flowchart is a pictorial representation in which symbols are used to show the various operations and decisions to be followed in solving a given problem.

Lesson tags: Computer Science Lesson Notes, Computer Science Objective Questions, SS2 Computer Science, SS2 Computer Science Evaluation Questions, SS2 Computer Science Evaluation Questions Third Term, SS2 Computer Science Objective Questions, SS2 Computer Science Objective Questions Third Term, SS2 Computer Science Third Term
Back to: COMPUTER SCIENCE/ICT – SS2 > Third Term