Algorithm Development
Algorithm Development
Development
What is an Algorithm
3
1- Analyze the problem
4
1- Analyze the problem
6
Pseudocode
End
Star
t
a, b
Flow Chart
a<
b Yes
(Ex. 1)
No
b is a is
smaller smaller
End
Algorithm
Start
Example 2
Enter first number
(a)
Print average
End
Star
t
a, b
sum = a +
Flow Chart b
average
End
Pseudocode Example
Enter a number
(number)
• Algorithm that prints whether an
entered number is positive or if number = 0 repeat A2
negative:
if number < 0, print “the entered number is negative” and
end the program
End
Start
num
Yes
num =
Flow Chart 0
No
Yes
num is
negative
End
Start
b, h
Flow Chart a=
(Ex. 4) b*h/2
End
Algorithm
Example 4 Start
Print a
End
Algorithm
Example 5 Start
Print average
End
Start
mt
fin
Flow Chart
(Ex. 5) average = 0.3*mt +
0.7*fin
average
End
Algorithm
Example 6 Start
End
Start
pi =
3.14
(Ex. 6) area =
pi*r*r
circumference
, area
End
Start
num = 0
num
End
Algorithm
Example 7
Start
• Algorithm to print numbers from 1
assign zero value to number
to 1000:
if number is greater than 999 end the
program
If not add 1 to number and assign result to number again (number =
number+1)
Print number and repeat A3
End
Algorithm Example
8
Start
A4 multiply the entered angle by 200, divide by the number pi and assign to the
grad (g=d*200/pi)
End
Start
Flow Chart
(Ex. 8)
End