Presentation is loading. Please wait.

Presentation is loading. Please wait.

Nested if-else Statements.  Should be indented to make the logic clear.  Nested statement executed only when the branch it is in is executed. For example,

Similar presentations


Presentation on theme: "Nested if-else Statements.  Should be indented to make the logic clear.  Nested statement executed only when the branch it is in is executed. For example,"— Presentation transcript:

1 Nested if-else Statements

2  Should be indented to make the logic clear.  Nested statement executed only when the branch it is in is executed. For example, the statement if (x == 5) { y = 20; } else { if (x > 5) { y = 10; } else { y = 0; } } evaluates the nested if-else only when x is not equal to 5.

3 Flowchart Symbols decision statements of work

4 Flow Chart Basics Rectangles represent statements of work. For example: print() Diamonds (decision symbol) contain conditions flow line

5 Flow Chart Basics Sequence structure Connector symbol Triangle boxes represent statements such as x=30; int a; System.out.print(“x”); x=20;

6 Flowchart


Download ppt "Nested if-else Statements.  Should be indented to make the logic clear.  Nested statement executed only when the branch it is in is executed. For example,"

Similar presentations


Ads by Google