CH 2. Algorithms With Block Coding
CH 2. Algorithms With Block Coding
ALGORITHM
SEARCHING FOR A WORD IN THE
DICTIONARY
Mukesh
Searching a word “proxy” in the dictionary
he first needs to find the dictionary section with the
first letter of the word, which in this case is 'p.'
Then, within the list of words starting the first letter
'p', he needs to find the section having the second
letter of the word 'r'.
Similarly, before writing a program code it is
essential to devise a set of steps to be followed to
solve the problem successfully. This set of steps is
called an algorithm.
FLOWCHART
A flowchart is a
diagrammatic representation
of the step-by-step plan to be
followed for solving a
task/problem statement.
SYMBOLS USED IN A FLOWCHART
BENEFITS OF USING A FLOWCHART
pseudocode is used to
describe the steps followed in
an algorithm via simple
human - comprehensible
language.
BENEFITS OF USING A PSEUDOCODE
The focus is mainly on including all the essential steps to solve the problem. Thus, the
solution tends to be comprehensive
Reviewers can quickly review the pseudocode & verify if the steps will generate the
desired outcome
While writing pseudocode, you can focus on all possible scenarios. So, this helps you
understand the potential problems that might come up later
Since you are not worried about coding syntax, you can concentrate on the actual
problem
Writing pseudocode will help writing your code much easier •
Works as documentation of the code. So even a layman with no coding knowledge can
refer to the pseudocode
ACTIVITY: PROFIT AND LOSS WITH
PSEUDOCODE