Unit 3-02

Learning Outcome

At the end of this lesson, you will be able to:

  • understand and use an if ... then ... else statement

Movie Watching

Review

  • if ... then statements

Lesson

  • go over "if ... then ... else", Chapter 3
    • Computer Based Problem Solving
  • look at "Too Many Student" program below

Activity

  • re-create the "Generate a Random Number" program, so you are conformable creating random numbers
  • create, in your groups, GUI Design, Top-down, flowchart
  • then write the code

Daily Assignment

  • re-create the "Number Guessing Game" program from before
    • use an If ... Then ... Else, so the user is told if the number is correct or wrong
    • use the random number generator to generate a new random number every time the program is started over
      • the number to guess would, therefore, have to be a Global variable

Extra

  • create the above program in a second language

Code Links

Homework!

  • read over "if ... then ... elseif ...", Chapter 3
    • Computer Based Problem Solving