ICM

9
ICM Conditionals

description

ICM. Conditionals. Conditionals. If p then q If it is raining then I will stay inside If it is not raining then I will go outside If it is sunny and warm then I will go to the beach. Conditionals. If (condition) then e lse then. Conditionals. If else Allow BRANCHING. - PowerPoint PPT Presentation

Transcript of ICM

Page 1: ICM

ICM

Conditionals

Page 2: ICM

Conditionals

• If p then q• If it is raining then I will stay inside• If it is not raining then I will go outside• If it is sunny and warm then I will go to the

beach

Page 3: ICM

Conditionals

• If (condition) then• else then

Page 4: ICM

Conditionals

• If • else• Allow BRANCHING

Page 5: ICM

Conditionals

if (mouseX < 100){ println(“mouseX is less than 100”);}else {

println(“mouseX is greater than or equal to 100”);}

Page 6: ICM

Boolean Logic

• boolean x = true;

Page 7: ICM

Boolean Logic

• ! – not• == - equality• && - and• || - or

Page 8: ICM

Boolean Logic

• < - less than• > - greater than• <= - less than or equal to• >= - greater than or equal to

Page 9: ICM

Boolean Logic

• Truth tables