Presentation is loading. Please wait.

Presentation is loading. Please wait.

Control structures Chapter 3.

Similar presentations


Presentation on theme: "Control structures Chapter 3."— Presentation transcript:

1 Control structures Chapter 3

2 Topics Assignment statement Selection: if..else
Multi-way selection: switch Repetition: p.88, 89 Functions: setup(), draw(), mousePressed()

3 Repetition Three kinds of loops For loop While loop Do while loop

4 Loops syntax While loop int i =0; while (i < 100) { do something;
i = i + 1; } For loop for (int i =0; i < 100; i = i +1) {

5 Loops syntax (contd.) int i = 0; Do { do something; i = i + 1; } while (i < 100);

6 Lets apply this to drawing some shapes
On to Processing: Draw 10 rectangles of different sizes and at different locations Draw 10 circles of different sizes and at different locations Parameter passing


Download ppt "Control structures Chapter 3."

Similar presentations


Ads by Google