CBCP2101 - Computer Programming I
CBCP2101 - Computer Programming I
CBCP2101 - Computer Programming I
SEMESTER 1163
CBCP2101
COMPUTER PROGRAMMING I
MATRICULATION NO : 901107025629001
E-MAIL : ikhwan_ishak@oum.edu.my
Input:
Output:
Pseudocode:
1.0 Start
2.0 Set y = 1 and i = 28000
3.0 For (y = 1 ; (y >= 1 and y <= 7) ; i decrement 4000) start_for
3.1 end_value ← i – 4000
3.2 accumulated_depreciation ← 4000*y
3.3 End_for
4.0 Print end_value and accumulated_depreciation
5.0 End
Tracing table:
y=1
i = 28000
depreciation = 4000
FALSE
y >= 1 AND y <= 7
TRUE
end_value ← i – 4000
accumulated_depreciation ← 4000*y
Print end_value
Print accumulated_depreciation
End