FIT100
If-Then-Else
Branch both ways with If-Then-Else
•
if (<
Boolean expression
>)
•
<
Then statement
>;
•
else
•
<
Else Statement
>;
•
Example …
if ((year%4)== 0) {
•
leapYear = true;
•
febDays = febDays+1;
•
}
•
else
•
leapYear = false;