{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lec3 - 2 Introduction to Conditionals Boolean expressions...

Info iconThis preview shows pages 1–15. Sign up to view the full content.

View Full Document Right Arrow Icon
2. Introduction to Conditionals Boolean expressions The If-Else Construct And, or, not
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
What We Cannot Do If the value of the arithmetic expression Dice1 + Dice2 is seven, then increase the value of the variable GamesWon by one. We cannot make a computation contingent upon other things.
Background image of page 2
The If-Else Construct Solves this Problem We will introduce this language feature by solving problems about the behavior of a given quadratic on a given interval L <= x <= R. c bx x x q + + = 2 ) (
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Assume Variables b,c,L,R are Initialized E.g., b = input(‘Enter b’:) c = input(‘Enter c’:) L = input(‘Enter L’:) R = input(‘Enter R’:)
Background image of page 4