Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Algorithm and flowchart
1. CLASS : 7
Subject : Computer
Topic: programming technique
Good morning
students
2. introduction
Computers can not perform any task on their own.
They need instruction to tell them what to do , how to do
and when to do.
A set of instruction that direct the computer to do a
specific task is called a program.
A task is actually a problem that is tracked by a
programmer.
Programming problem need to be divided in to smaller
step .
3. Continue…….
So that each step can be formulated in the form of an
instruction written in a programming languages.
The activity is termed as a computer programming.
Computer programming is a sequence of steps requires
for a solving a problem with the help of computer
programming are algorithm , flowchart and pseudo
code(source code).
4. An algorithm is a step by step
procedures to solve a particular
problem.
It has a finite number of steps.
To write algorithm , we use simple
English language.
5. General rules for writing an Algorithms:
An algorithm should have finite number
of steps.
Algorithm should not dependent on a
particular computer language.
The step should be executable by
computer.
Algorithm is independent of
programming language.
An algorithm must produce an output.
6.
7. Characteristics of Algorithms:
Precision – the steps are precisely
stated(defined).
Uniqueness – results of each step are
uniquely defined and only depend on the
input and the result of the preceding steps.
Finiteness – the algorithm stops after a finite
number of instructions are executed.
Input – the algorithm receives input.
Output – the algorithm produces output.
Generality – the algorithm applies to a set of
8.
9. Advantages of algorithm
It is a step-wise representation of a solution
to a given problem, which makes it easy to
understand
It is not dependent on any programming
language, so it is easy to understand for
anyone even without programming
knowledge.
Every step in an algorithm has its own
logical sequence so it is easy to debug.
By using algorithm, the problem is broken
down into smaller pieces or steps hence, it
10. Disadvantages of algorithm
Algorithms is Time consuming.
Difficult to show Branching and
Looping in Algorithms.
Big tasks are difficult to put in
Algorithms
Writing algorithm takes a long time.
An Algorithm is not a computer
program, it is rather a concept of how
a program should be.
11. solved examples
1. Write an algorithm to give instruction for making maggi
noodles as a food.
Step 1: Start
Step 2: Take pan with water
Step 3: Put pan on the burner
Step 4: Switch on the gas/burner
Step 5: Put magi and masala
Step 6: Give two minutes to boil
Step 7: Take off the pan
Step 8: Take out the magi with the help of fork/spoon
Step 9: Put the Maggi on the plate and serve it
Step 10: Stop
12. solved examples
1. Write an algorithm to make cup of tea.
Step 1:Put the teabag in a cup.
Step 2:Fill the kettle with water.
Step 3:Boil the water in the kettle.
Step 4:Pour some of the boiled water into
the cup.
Step 5:Add milk to the cup.
Step 6:Add sugar to the cup.
Step 7:Stir the tea.
Step 8:Drink the tea.
13.
14. solved examples
1. Write an algorithm to find simple interest.
Step 1:Start
Step 2:Read Principal Amount, Rate and
Time
Step 3:Calculate Interest using formula SI=
((principal*rate*time)/100)
Step 4:Print Simple Interest
Step 5:Stop
15. solved examples
1. Write an algorithm to find area of circle.
Step1: Start
Step2: Input the the value of radius R
Step3: Let PI=3.14
Step4: Calculate area=PI*R*R
Step5: Print area
Step6: End
16. solved examples
1. Write an algorithm to find greatest number
among two number.
Step1: Start
Step2: Input number1 and number2
Step3: is a>b ?
-if yes print “a is greatest number”
-if no print “b is greatest number”
Step4: End
17. solved examples
1. Write an algorithm to find area of rectangle.
Step1: Start
Step2: take length and breadth and store in
it L and B.
Step3: multiply L and B and store in it area.
Step4: print area
Step5: End
18.
19. Advantages of flowchart
The Flowchart is an excellent way of communicating the
logic of a program.
It is easy and efficient to analyze problem using flowchart.
During program development cycle, the flowchart plays the
role of a guide or a blueprint. Which makes program
development process easier.
After successful development of a program, it needs
continuous timely maintenance during the course of its
operation. The flowchart makes program or system
maintenance easier.
It helps the programmer to write the program code.
It is easy to convert the flowchart into any programming
language code as it does not use any specific
20. Disadvantages of flowchart
The flowchart can be complex when the logic of a program
is quite complicated.
Drawing flowchart is a time-consuming task.
Difficult to alter the flowchart. Sometimes, the designer
needs to redraw the complete flowchart to change the logic
of the flowchart or to alter the flowchart.
Since it uses special sets of symbols for every action, it is
quite a tedious task to develop a flowchart as it requires
special tools to draw the necessary symbols.
In the case of a complex flowchart, other programmers
might have a difficult time understanding the logic and
process of the flowchart.
It is just a visualization of a program, it cannot function like
an actual program