Unit 3-03
Learning Outcome
Learning Outcome
At the end of this lesson, you will be able to:
- understand and use an if ... then ... else statement
Review
Review
- if ... then ... else statements
Lesson
Lesson
- go over "if ... then ... else" and "Compound Boolean Expressions", Chapter 3
- Computer Based Problem Solving
Activity
Activity
- null
Daily Assignment
Daily Assignment
- we will be working on this next day as well since it is quite a complex problem
- create a "Rock, Paper and Scissor" program
- use a "random Class" to generate a random number between 1 - 3 for the computers choice
- use a 3 level If...Then...Else... Statement to see who wins( 3 possible choices win, lose, draw)
- there are 9 different combinations though
- but three are if both are equal, so that is an easy one
- there are 9 different combinations though
- each Boolean expression will be a compound
- except for when it is a tie
- ENSURE you think about this BEFORE you start to program, or you will get nowhere!
- that means a design document
- top-down
- flow-chart
- pseudo-code
- that means a design document
Extra
Extra
- create the above program in a second language
Homework!
Homework!
- read over "nested if statements", Chapter 3
- Computer Based Problem Solving