Professional Documents
Culture Documents
Sample Algorithms: Algorithm
Sample Algorithms: Algorithm
Sample Algorithms
Algorithm
Step 1: Initialize Total, First Division, Total _Mark sheets
_Checked to zero.
Step 2: Take the mark sheet of the next student.
Step 3: Check the division column of the mark sheet to
see if it is FIRST. If no, go to Step 5.
Step 4: Add 1 to Total First Division.
Step 5: Add I to Total_Marksheets_Checked
Step 6: Is Total_Marksheets_Checked = 50? ifno, go to
Step 2.
Step 7: Print TotaI First_Division.
Step 8: Stop.
Flowchart
A flowchart is a pictorial representation of an algorithm. It
is often used by programmers as a program-planning tool
for organizing a sequence of steps necessary to solve a
problem by a computer. It uses boxes of different shapes to
denote different types of instructions. The actual
instructions are written within these boxes using clear and
concise statements. These boxes are connected by solid
lines having arrow marks to indicate the flow of operation,
that is, the exact sequence in which the instructions are to
be executed. The process of drawing a flowchart for an
algorithm is often referred to as flowcharting.