Lecture 10: Conditionals Continued
Wednesday, February 29, 2012[Up] [Previous Lecture] [Next Lecture]
Reading Assigned: 4.1 - 4.3
Homework Due: Homework 04
Homework Assigned: Homework 05
Classwork Assigned: Classwork 06
Topics Covered:
- Homework 4 review and example solution
- Reminder: Quiz next Monday (paper or blackboard?)
- Example questions for quiz
- Logical operators
- Allow us to combine multiple test conditions in one if using boolean logic
- || OR, true if either left side or right side is true
- && AND, true only if both left and right side are true
- Example of using logical operators
- Note that this example shows putting an if block inside another if block as well
- You will want to use logical operators in the classwork
- Classwork 6 using if-else
- The following examples can be used as a template for today's classwork
- Example comparing two value
- More complex example with if-else chaining