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) { // do this stuff // or not at all } No semicolon. It’s a code block.
if syntax if (condition) { // do one thing } else { // or the other }
if syntax if (condition) { // do this thing } else if (condition2) { // or this thing } else if (condition3) { // or even this thing } else { // otherwise do this }
Lab Goals • Understand the rubric for InputValidation and PaperScissorsRock • Get started with InputValidation • Get started with PaperScissorsRock
Homework • Complete InputValidation • Complete PaperScissorsRock
Recommend
More recommend