csci261e f
play

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)


  1. CSCI261E/F Lab 3: flow control (if, if-else) September 10, 2010

  2. ?

  3. Review • Boolean expressions • get evaluated and yield true or false • Boolean values are really 0 or 1 • if • if/else • nested if statements

  4. if syntax if (condition) { // do this stuff // or not at all } No semicolon. It’s a code block.

  5. if syntax if (condition) { // do one thing } else { // or the other }

  6. if syntax if (condition) { // do this thing } else if (condition2) { // or this thing } else if (condition3) { // or even this thing } else { // otherwise do this }

  7. Lab Goals • Understand the rubric for InputValidation and PaperScissorsRock • Get started with InputValidation • Get started with PaperScissorsRock

  8. Homework • Complete InputValidation • Complete PaperScissorsRock

More recommend