CHAPTER 02
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
Some of the benefits of using a flowchart are:
1. It helps to explain your approach towards solving a
problem
2. The flowchart helps in bringing in visual clarity to a
problem, so it helps in practical problem solving
3. Once you build a flowchart, this remains as
documentation of the code you are about to build. If you need to
come back and understand the code, you can refer to the flowchart.
PROFIT AND LOSS WITH FLOWCHARTS
PSEUDOCODE
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