ALGORITHMS AND FLOWCHART
CONTENT
- Writing an Algorithm
- Flowchart Symbols and their Uses
- Use of Flowchart
- 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
- 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.
- NEW: Download the entire term's content in MS Word document format (1-year plan only)
- The complete lesson note and evaluation questions for this topic
- The complete lessons for the subject and class (First Term, Second Term & Third Term)
- Media-rich, interactive and gamified content
- End-of-lesson objective questions with detailed explanations to force mastery of content
- Simulated termly preparatory examination questions
- Discussion boards on all lessons and subjects
- Guaranteed learning