90 likes | 289 Views
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.
E N D
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 • else then
Conditionals • If • else • Allow BRANCHING
Conditionals if (mouseX < 100){ println(“mouseX is less than 100”); } else { println(“mouseX is greater than or equal to 100”); }
Boolean Logic • boolean x = true;
Boolean Logic • ! – not • == - equality • && - and • || - or
Boolean Logic • < - less than • > - greater than • <= - less than or equal to • >= - greater than or equal to
Boolean Logic • Truth tables