visual logic

17
VISUAL LOGIC Chapter 4

Upload: shadow

Post on 24-Feb-2016

65 views

Category:

Documents


0 download

DESCRIPTION

Visual Logic. Chapter 4. For Loops. Used to automate the initialize , test , and update process. . Count a to b by c . Count a to b. a: Initialize b: Test Step = 1. a: Initialize b: Test c: Step. Step Value in For Loops. For Loop with Negative Step Value Example. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Visual Logic

VISUAL LOGICChapter 4

Page 2: Visual Logic

Used to automate the initialize, test, and update process.

For Loops

Counta to b by c

Counta to b

a: Initializeb: Testc: Step

a: Initializeb: TestStep = 1

Page 3: Visual Logic

Step Value in For Loops

Page 4: Visual Logic

For Loop with Negative Step Value Example

Page 5: Visual Logic

Comparing While and For Loops

While• Explicit Initialization statement • Explicit Test Condition statement• Explicit Update statement

For• Automatically performs these three actions

Page 6: Visual Logic

Comparison of While and For Loops

Page 7: Visual Logic

Example

Page 8: Visual Logic

Loop contained inside the body of another loop

Nested Loops

Page 9: Visual Logic

Nested loop- Printing the values of outer loop and inner loop counters

Page 10: Visual Logic

Printing “Hello” 16 times- Solution 1

Page 11: Visual Logic

Printing “Hello” 16 times- Solution 2

Page 12: Visual Logic

Multiplication Table Example

Page 13: Visual Logic

Triangle Problem Example

Page 14: Visual Logic

Some Graphics

Drawing a Box

Page 15: Visual Logic

More Box Demo

Page 16: Visual Logic

Fun Box

Page 17: Visual Logic

Twisted Box with Color