You are on page 1of 12

CH1: Intro.

To Programming
1.1 Electronic Computer
1.2 Intro.to Programming
1.3 Program Development Cycle
1.4 Algorithm Design

prepared by omarabuhassan07@gmail.com

1.4 Algorithm Design


ALGORITHM ORIGINALLY REFERED TO ANY
COMPUTATION PERFORM VIA SET OF RULES
APPLIED TO NUMBERS WRITTEN IN DECIMAL
FORM.
Algorithm = step by step procedure to solve a
given problem
prepared by omarabuhassan07@gmail.com

1.4 Algorithm Design


An algorithm is a representation of a solution to a problem
Meaning that, if a problem can be define as a difference between a desired
situation and the current situation, then a problem solution is a procedure, or
method for transforming the current situation to the desired one.
Preparing solution to current problem will requires little intellectual effort and
usually involves in understandable solution or procedure that others can
understand

prepared by omarabuhassan07@gmail.com

1.4 Algorithm Design


SKIP PROBLEM DEFINE STEP AS THE STEP IS CONSIDERED BASIC
KNOWLEDGE FOR ENGINEERING STUDENT
TWO IMPORTANT STEPS IN ALGORITHM
PSEUDOCODE
FLOWCHART
Important! ABILITY TO DO CONVERSION BETWEEN BOTH STEPS
prepared by omarabuhassan07@gmail.com

1.4 Algorithm Design-pseudocode


WHAT IS PSEUDOCODE?
One of the tools that can be used to write a preliminary plan that
can be developed into computer program.
PSEUDOCODE is a generic way of describing an algorithm without
use of any specific programming language syntax.
As its name, it cannot be executed on real computer, but it models
and resembles real programming code, and written at roughly the
same level of detail.

prepared by omarabuhassan07@gmail.com

1.4 Algorithm Design-PSEUDOCODE 2


WHY USE PSEUDOCODE?
In algorithm design, the steps of the algorithm are written in free
English text and although brevity is desired, they may be as long as
needed to describe the particular operation.
The steps of an algorithm are said to be written in pseudocode
So, many languages such Pascal, have syntax that is almost identical
to pseudocode and hence make the transition from design to coding
extremely easy.

prepared by omarabuhassan07@gmail.com

1.4 Algorithm Design-PSEUDOCODE 3


PSEUDOCODE FORM
Step number is optional
Sub-procedure is indented
to show it is under one of
the main procedure
Use understandable
language

prepared by omarabuhassan07@gmail.com

1.4 Algorithm Design-PSEUDOCODE 4


PSEUDOCODE GENERAL RULES!
Should present step-by-step solution that can be understand by
other people.
Sub-process should be indent from the main procedure/
solution.
Can include step numbers in the pseudo code to shows the
number of main procedure taken in the solution

prepared by omarabuhassan07@gmail.com

1.4 Algorithm Design-flowchart


WHAT IS FLOWCHART?
It is a tool developed in the computer industry, for showing the steps
involved in a process.
A flowchart is a diagram made up of boxes, diamonds and other
shapes, connected by arrows.
Each shape represents a step in the process and the arrows show the
order in which they occur.
In simple words, flowchart is the steps involves to solve the problem

prepared by omarabuhassan07@gmail.com

1.4 Algorithm Design-flowchart2


FLOWCHART SYMBOLS (most used symbols)
Start/End (1) terminal symbol indicates the starting
or ending of the program, process or interrupt
program
Process box (2) in rectangular shape indicates any
type of internal operation inside the processor or
memory
Input / Output (3) box used for any input or output
operation. Its indicates that the computer is to
obtain data or output results.
Decision box (4) use to ask a question that can be
answered in a binary format (Yes/No, True/False)
prepared by omarabuhassan07@gmail.com

1.4 Algorithm Design-FLOWCHART3


GENERAL RULES
Flowchart should have start/begin and end.
Every shapes represent specific and must be label
accordingly.
Every shape should be connected using arrows and should
have in and out except for start and end.

prepared by omarabuhassan07@gmail.com

1.4 Algorithm Design


Summary of Chapter 1:
General understanding of computer hardware and software?
Idea of basic programming language and levels of language availables
Full knowledge in program, development cycle?
Able to differentiate between pseudocode and flowchart
Able to solve problem using algorithm method.

prepared by omarabuhassan07@gmail.com

You might also like