Programming Lecture 2
Programming Lecture 2
Programming
Lecture 2
10
End Start Start/End
Print n1 Read n1 Input/Output
Input
Gregorian date Input data from user
Convert Gregorian
date to Islamic date Perform the date conversion
Display
Display the result
Islamic date
Input start
Input three numbers N1,N2,N3
Processing Read N1,N2,N3
Average =(N1+N2+N3)/3
Output Average =(N1+N2+N3)/3
Average
Print Average
End
Example 2
14
Input
Read L, W
Length
width
area = L * W
Processing
Area = length*width perimeter = 2 (L+W)
Perimeter = 2*( length + width)
End
Example 3
16
Input start
Salary
Overtime Read Salary
Processing
Total_Sal = Salary +Overtime
Read Overtime
Output
Total_Sal =
Total_Sal
Salary +Overtime
Print Total_Sal
End
Statement structures
•18
Output
Print “below freezing” or “above freezing”
Solution
21
Example 5
22