AN ILLUSTRATIVE
COMPUTER
ALGORITHM
TO DETERMINE THE BLOOD GROUPS OF
HUMAN BY A, B, O BLOOD GROUP
SYSTEM.
PROCEDURE:-
1. Take a clean slide and mark the point A, B, and D.
2. Sterilize the finger with alcohol with a bold prick with
the help of sterilize needle.
3. Put one drop of blood on each and mark the position
on slide.
4. Put a drop of antiserum A on mark A, antiserum B on
mark B and antiserum D on mark D (Rh-factor).
5. Thoroughly mix the drop of blood with the antiserum
by using tooth pick. Allow 2-5minites for the
agglutination to take place.
6. Observe the slide for agglutination with naked eye and
then under microscope
COMPUTER PROGRAMMING ALGORITHM
Identify the Problem
Design a Solution
Write the Program
Check the Solution
Step 1: Identify the problem. When students are new to CP,
we typically start teaching them how to program and code
using tutorials. ...
Step 2: Find a solution. To find or plan the solution to the
problem identified in Step 1, students can either create a
flowchart.
Step 3: Code it.
Step 4: Test it.
DEVELOPING OF THE ALGORITHM
An Algorithm Development Process
Step 1: Obtain a description of the problem. This step
is much more difficult than it appears. ...
Step 2: Analyze the problem. ...
Step 3: Develop a high-level algorithm. ...
Step 4: Refine the algorithm by adding more detail. ...
Step 5: Review the algorithm.
ALGORITHM HAS THE FOLLOWING
CHARACTERISTICS
•Input: An algorithm may or may not require input.
•Output: Each algorithm is expected to produce at least
one result.
•Definiteness: Each instruction must be clear and
unambiguous.
•Finiteness: If the instructions of an algorithm are
executed, the algorithm should terminate after finite
number of steps.
ADVANTAGES OF ALGORITHM
It is a step-wise representation of a solution to a given
problem, which makes it easy to understand.
An algorithm uses a definite procedure.
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.
THE ALGORITHM AND FLOWCHART INCLUDE
FOLLOWING THREE TYPES OF CONTROL
STRUCTURES.
1. Sequence: In the sequence structure, statements
are placed one after the other and the execution takes
place starting from up to down.
2. Branching (Selection): In branch control, there is
a condition and according to a condition, a decision of
either TRUE or FALSE is achieved. In the case of
TRUE, one of the two branches is explored; but in the
case of FALSE condition, the other alternative is
taken. Generally, the ‘IF-THEN’ is used to represent
branch control.
3. Loop (Repetition): The Loop or Repetition allows
a statement(s) to be executed repeatedly based on
certain loop condition e.g. WHILE, FOR loops.
PSEUDOCODE & ALGORITHM
Pseudocode:
Input a set of 4 marks
Calculate their average by summing and dividing by 4.
If a.verage is below 50 Print “FAIL” else Print “PASS
FLOW CHART
A flowchart is a blueprint that pictorially represents
the algorithm and its steps.
The steps of a flowchart do not have a specific size
and shape rather it is designed in different shapes
and sizes (see the image given below).