Nested if-else Statements and flow charts

Nested if-else Statements
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, 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.
Flowchart Symbols
decision
statements of work
Flow Chart Basics
Diamonds
(decision symbol)
contain
conditions
Rectangles represent
statements of work.
For example:
flow
line
print()
Flow Chart Basics
Sequence structure
Connector symbol
Triangle boxes represent statements
such as
x=30;
int a;
System.out.print(“x”);
x=20;
Flowchart