SLIDE 1
CSCI261E/F
Lab 3: flow control (if, if-else) September 10, 2010
CSCI261E/F Lab 3: flow control (if, if-else) September 10, 2010 ? - - PowerPoint PPT Presentation
CSCI261E/F Lab 3: flow control (if, if-else) September 10, 2010 ? Review Boolean expressions get evaluated and yield true or false Boolean values are really 0 or 1 if if/else nested if statements if syntax if (condition)
Lab 3: flow control (if, if-else) September 10, 2010
if (condition) { // do this stuff // or not at all }
No semicolon. It’s a code block.
if (condition) { // do one thing } else { // or the other }
if (condition) { // do this thing } else if (condition2) { // or this thing } else if (condition3) { // or even this thing } else { // otherwise do this }
and PaperScissorsRock