CSCI261E/F Lab 3: flow control (if, if-else) September 10, 2010 ? - - PowerPoint PPT Presentation

csci261e f
SMART_READER_LITE
LIVE PREVIEW

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)


slide-1
SLIDE 1

CSCI261E/F

Lab 3: flow control (if, if-else) September 10, 2010

slide-2
SLIDE 2

?

slide-3
SLIDE 3

Review

  • Boolean expressions
  • get evaluated and yield true or false
  • Boolean values are really 0 or 1
  • if
  • if/else
  • nested if statements
slide-4
SLIDE 4

if syntax

if (condition) { // do this stuff // or not at all }

No semicolon. It’s a code block.

slide-5
SLIDE 5

if syntax

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

slide-6
SLIDE 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 }

slide-7
SLIDE 7

Lab Goals

  • Understand the rubric for InputValidation

and PaperScissorsRock

  • Get started with InputValidation
  • Get started with PaperScissorsRock
slide-8
SLIDE 8

Homework

  • Complete InputValidation
  • Complete PaperScissorsRock