Presentation For Computer Science

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 5

INTRODUCTION

OF ALGORITHM
WHAT IS ALGORITHM
• A series of procedure to fix a problem or do a task.
• Consist of two types:
A.) Flow chart B.)Pseudocode
Example of algorithm in real life
WHEN YOU NEED TO BUY A LOAF OF BREAD IN A SUPERMARKET:

1.ENTER THE SUPERMARKET 2. FIND THE PASTRY SECTION 3. CHOOSE YOUR FAVOURITE
BREAD

5. EAT BREAD 4. PAY MONEY


FLOWCHART
• A diagram which represent the workflow of the whole algorithm step
by step
• Every symbol in a flowchart represent its own function
SYMBOL NAME FUNCTION
START/END terminal Start or end the flowchart

INPUT/OUTPUT Read input or show output

PROCESS Process the input

DECISION Make a choice based on the


requirement

ARROW Connect btw the symbol to


show the workflow
EXAMPLE OF FLOWCHART
START
REMARK:
• Equality & relational
INPUT YOUR MARK
operators can be
used for the decision
symbol
• Example: Mark >= 40 ? GRADE = “PASS”
== : Same as
> : More than
< : Less than
>= : Same or more
Mark < 40 ?
than
<= : Same or less
than
!= : Not same as GRADE = “FAIL”

OUTPUT GRADE

END

You might also like