Flowchart and algorithm
Source from: SLIDESHARE.COM
Problem Solving
1. In order to solve any problem by using computer, it is very imperative to
Detail the precise problem
Itemizing the configuration
2. The process of solving the problem is known as the “Problem analysis”.
PROBLEM SOLVING STAGES
A problem solving process consists of eight stages as:
Defining the problem
Algorithm
Flowchart
Coding
Input Preparation
Compilation
Debugging
Testing
DEFINING THE PROBLEM
1. This step has a great importance in obtaining the correct solution of the
problem.
2. The solution of the problem depends upon the description and
understanding the problem.
3. This requires analysis of the problem to find the nature of the problem
analysis of the input data and planning of the output result.
4. This step achieves following goals
Defining the Problem
Problem description
Determination of the objective
Analysis of the input data
Planning of output
ALGORITHM
Series of procedural steps required to solve a given problem is called an
algorithm.
The construction of the algorithm is the stage which requires steps or operations
which collectively solve 'a given problem.
An algorithm usually is in ordinary English language and use some mathematical
symbols, if it is possible to solve a given problem in more than one ways.
The choice of particular algorithm depends upon various such as its reliability,
accuracy and ease of modification.
One of the most important factor in the choice of an algorithm is the time
requirement to execute it (after it in high level language) with the help of
computer.
The algorithm which will least time when executed by a computer is considered
the best.
EXAMPLE 01
Write an algorithm to print given roll number and name.
Step 1: Enter Roll number.
Step 2: Enter Name
Step 3: Print Roll number
Step 4: Print name
Step 5: Stop
EXAMPLE 02
Write an algorithm to print the first ten natural numbers.
Step-I: Select a counter A .
Step-2: Initialize A as zero
Step-3: Add 1 to A
Step-4: Print A
Step-5: If A <10 then go to step-3
Step-6: Stop
1.
EXAMPLE 3
1. Write an algorithm to print the greatest number from two given numbers.
Step-I: Enter two numbers as A and B
Step-2: If A > B then Print A and go to step 4
Step-3: Print B
Step-4: Stop
EXAMPLE 4
2.Write an algorithm to print a table of a given number
o Step-1: Select two counters as B and C
o Step-2: Initialize the counters B and C as zero
o Step-3: Enter a, number of table as A
o Step-4: Add 1 to B
o Step-5: Multiply A to B and assign the result to C
o Step-6: Print A; B and C
o Step-7: Check the value of B; If B<1O then go to step-4
o Step-8: Stop
EXAMPLE 05
Write-an algorithm to print square and cubes from 1 to 5
Step-1: Select the counter A, B and C
Step-2: Initialize B and C as zero
Step-3: Initialize A as 1
Step-4: Calculate B as A*A
Step-5: Calculate C as A*A*A
Step-6: Print A, B, and C.
Step-7: Add 1 to A
Step-8: Check the value of A; if A < 5 then go to step-3
Step-9: Stop
FLOWCHART
A flowchart is a pictorial representation of the steps of a involved in the
procedure of solving any problem.
The first formal flowchart was designed by John Von Neumann‘.
A flowchart is drawn before the program in written to ensure the instructions will
be logically integrated.
A flowchart is not a complete program but It is an aid to programming.
There are two types of flowchart
Which are:
System Flowchart
Program Flowchart
A system flowchart shows the flow of data throughout a data process as well as
the flow into and out system. The system analyst will use such a design and to
explain a data processing system.
Program flowchart is a pictorial representation of the method and sequence, to
be followed for solving a particular problem.
There are several sets of the symbols, which are standardized by
American National Standard Institute International Standard Organization
(ISO) to draw the flowchart.
Most commonly used symbols are Oval, Parallelogram, Rectangle,
Diamond, Arrows, Connectors.
1. OVAL
This ‘symbol' is used for beginning or end of a flowchart. Therefore, it is also
named as “TERMINAL.
2. PARALLELOGRAM:
1. This symbol is used for transfer of data between Central Processing Unit
(CPU) output devices.
2. In the simple words we can say this symbol is used to represent and
output operations.
3. Therefore, it is also known as INPUT/OUTPUT box.
4. INPUT/ OUTPUT
3. RECTANGLE
1. RECTANGLE:
2. This symbol is used to represent
any arithmetic operation or
transfer of data.
3. This symbol is also known as PROCESS box.
EXAMPLE 1
ACTIVITY
ANSWER THE ACTIVITY
-THANK YOU-