1. Sequence
2. Selection
3. Iteration.
Posting pada kali ini masih membincangkan jenis yang ke tiga iaitu Iteration.
Camkan (identify) 3 perkara di bawah terhadapt pseudocode dan flowchart yang di berikan:-
i) The initialization of the loop control
ii) The loop repetition condition.
iii) The update of the loop control.
Flowchart 1
Pseudocode 1
II. print counter
III. increase counter by 1
IV. repeat steps 2,3 until counter equals to 10
Pseudocode 2
I. Get a value for n.
II. Give p the value 1.
III. While n is positive
3.1 Multiply p by n
3.2 Substract 1 from n
IV. Print p
No comments:
Post a Comment