2. Introduction to
Conditionals
Boolean expressions
The If-Else Construct
And, or, not

This
** preview**
has intentionally

**sections.**

*blurred***to view the full version.**

*Sign up*
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.

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
)
(

This
** preview**
has intentionally

**sections.**

*blurred***to view the full version.**

*Sign up*
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’:)