Personal tools
You are here: Home Members mpate1's Home Lab5-If
Document Actions

Lab5-If

by Mit Patel last modified 2006-02-14 02:38 AM

Control Statements:

(1.) 'Selection': if and nested if (2.) 'Loops': while, for and do.

This lab will go over how to use if and nested if in your application.

if (pg. 128):

if (condition1){

…statement that does something;

}else{

…statement that does something else;

}

Multibranch Selection:

if (condition1){

… do something;

}else if(condition2){

… do this instead;

}

Nested if (pg. 129):

if (condition1){

if (condition 2){

… do something;

else

... do something;

}

}

else {

… do this instead;

}

Condition:
Has to be a boolean expression that evaluates to true or false.

If the condition is true the statement (or the body of if) is executed otherwise skipped.


Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: