CSC_Algo and Flowwork
CSC_Algo and Flowwork
LEARNING OUTCOMES
The student will be able to:
• know about algorithms and flowcharts.
• write algorithms and draw flowcharts.
· steps m
In your daily life ' you carry ou t certam · order to perform a task and
· a sequent1al
get the desired result.
Let us und erstand the above statement with the help of the example given:
Process of Brushing Teeth
1. Take your brush from the shelf.
2. Turn on the tap of your wash basin.
3. Rinse the brush and turn off the tap.
4. Apply toothpaste on the brush.
5. Start brushing your teeth. •
6.
7.
Clean the brush and rinse your mouth.
Take your tongue cleaner. j
-
8. Clean your tongue.
9. Rinse your mouth again and clean your tongue cleaner.
10. Finally you get the desired result, i.e., shiny white teeth and a clean mouth.
Similarly, to solve any problem on a computer, you analyse and understand the nature
of the problem first. You plan the input and apply the appropriate methods, step-by-
step to get the desired result. This step-by-step procedure to solve any problem is called
Algorithm.
t) Algorithm
An algorithm is a set of sequential steps to solve any logical or mathematical problem. It
is always written in simple language and precise manner so that anyone can understand
the steps.
Characteristics of an Algorithm
Not all procedures can be called an algorithm. An algorithm should have the different
characteristics as listed on the next page.
lear and expllc,t. Each of
Unambiguous: An algorithm should be c
its steps should be clear and must lead to only one meaning.
bpla,n the process of Input: An algorithm should have well-defined input.
preparing a vegetable
sandwich. Output: An algorithm should have at least 1 well-defined output,
that should match the desired result.
Finiteness: An algorithm must terminate after a finite number of
steps.
Independent: An algorithm should have step-by-S t ep instructions,
which should be free from any programming code.
Consider the following examples to understand how to write
r
algorithms.
Example 1: Algorithm to set your school bag
Step 1: Start
Step 2: See the timetable.
Step 3: Go to your bookshelf.
Step 4: Take out the books and notebooks
according to the next day's schedule.
Step 5: Keep them in the bag.
Algorithms help you to Step 6: Close the bag.
understand the problems
and their solution in a Step 7: Stop.
better way.
Example 2: Algorithm to calculate the sum and average of three
numbers.
Step 1: Start
Step 2: Input first number (A).
Step 3: Input second number (B).
Step 4: Input third number (C).
li Step 5:
Step 6:
Step 7:
Find the sum of three numbers (A+B+C).
Find the average (A+B+C)/3.
Print Average.
Step 8: Stop
Flowcharts assist in
finding and removing After it boils, take off the pan.
errors at different steps,
and in different phases of
the program. Strain it in a cup and serve the hot tea.
Stop
Sum= A+ B
Print Sum
Difference = A - B
Start
Input A and B
No
Yes
No Both numbers
are equal
Bis
A is
greater than A
greater than B
Stop
AP .-- - - - - - - - -
• To solve any problem on a computer, you analyse and understand the nature of the
problem first.
• The step-by-step procedure to solve any problem is called Algorithm.
An algorithm should be clear and explicit.
An algorithm should be free from any programming code.
A flowchart is a pictorial representation of steps of an algorithm used for solving a
J>articular problem.
A flowchart should consist of st andardised and acceptable symbols.
flowchart should have short, clear, and readable statements written inside the symbols.
A. Fill in the blanks.
1. An .............................. 1s
. a set of sequent1a
- l step s that helps in solving a problem.
2. The.............................. bo x represents t he beg mmng or ending point of a program.
3. The .............................. box is used to enter data and give the result of a program.
4. The .............................. box is used to apply a condition in a program.
5. Th e .............................. are use to Jom one par o
d . . t f the flowchart to another.
1:tt33>
• Input/Output • Decision • Algorithm • Connectors • Start/Stop box
a. Terminators
b. Connectors
c. Flow lines
4. The pictorial representation that illustrates the steps of the sotut · t bl • ll d
············································· . 1 on o a pro em 1s ca e
a. Algorithm
b. Flowchart
c. None
4 C I 4
1
ls A> B
] Stop
··································································································································································
························································· ····································································· ....................................
··································································································································································
2. What is an algorithm?
············································································ . .......................................................
··································································································································································
·················· ........................ ··························· ········· .................................................................·············· .... .
4. Distinguish between the flow lines and connectors.
···············································································
••••••••••••••••••••••••• •••••••••••••••••••••••••••••••• t •••••••••••••••••••••• • •••••••••••• • ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
b. AutoSum
c. Addition
b. Satellite c. Hotspot
0 ITI;Q(0lrl~Ll\~[jjwl
Chapters 5-9
Name: ....................................... Date: .................................
A. Short-answer questions .
········•······························································································································
···························
2 · Name the block category which
contains blocks to solve mathematical equations.
·······································································································································
···························
3. What was the name of the first electronic spreadshee
t?
·······································································································································
··•························
B. Long-answer questions.
................................................................................................................................................
..................
·······································································································································
···························
................................................................................................................................................
..................
3. What is the use of a Search Engine?
·······································································································································
···························
·······································································································································
···························
4. Write the use of Hotspot.
······························································ ········································································
····························
·······································································································································
···························