CHAPTER 5 OVERVIEW -HENDRICKSON
5. Ch-5 Selection statements
   a. Lecture over new concepts
        5.1 Boolean Expressions
           1. Understand the need for a boolean data type
           2. To use relational operators
           3. To Understand the Hierarchy(order of operations "plus")
           4. Use logical "and" , "or" & not
           5. Use compound boolean expressions(and=X, or = +)
           6. Understand "short circut" evaluations of "and" .."or"
        5.2 if-statements
           1. Learn syntax of simple "if"
           2. Understand the flow of logic
           3. Use "if" in a program
           4. Correct syntax in writing a compound(and/or) statement
           5. Write programs using "if" statements
        5.3 if-else statements
           1. Learn syntax of if..else statements
           2. Understand the flow of logic of if..else statements
           3. Use in a program
           4. Design programs using if..else statements
        5.4 Nested if statements
           1. Learn syntax
           2. Know when to use nested if
           3. Know how to extend nested if statements
           4. Be able to trace logic
           5. Develop consistant writing style with nested if's.
        5.5 Switch Statements
           1. Learn the syntax of the switch statement
           2. Compare switch with nested if as a multiway exit
           3. Use switch statements in designing programs
        5.6 Assertions(more later in chapter 7..very important
           1. Know how to assert pre-conditions
           2. Know how to assert post-conditions
           3. Reference use in file-I/O chapter 7(teacher comment)
        5.7 Graphics
           1. use selection statement in a graphics format
           2. Use boolean statements in graphics formats

        Case Study(Gas-n-Clean Service Station)(honors only)


   b. Programming assignments discussion
      1. program a  p282  #1(regular)
      1. program a  p282  #2(honors)
      2. program b  p282  #4(regular)
      2. program b  p282  #6(honors)(use and/or/not)
      3. program c  p282  #9(regular)if-then or and
      3. program c  p282  #10(honors)if-then or and
      4. program d  p284  #13(regular)if-then or and or switch(see inst)
      4. program d  p284  #15(honors)(application)

      5. program e  p289  #29(regular)(switch)
      5. program e  p288  #28(honor)(fractions)

      6. program f  p290  #32(regular)(select shape)
      6. program f  p290  #33(honor)(dice)
        
   c. Debugging techniques
      See chapter 3 & 4 for earlier lists
        1.  Use "f8" to trace the logic of programs using chosen data
        2.  Check boundary cases for correctness
        3.  Avoid branches that are never used.
        4.  Check syntax 
            a.(..) and (..)  
            b. if (x>y) { statement_1; statement-2;}..note braces
            c. ..else {statement_3; statement-4;} note more braces..
        5. switch (x) {....} ..open & close brace
        6. don't use the word "or"  ..>"||"
        7. assertions are over-kill at this point..wait 'till chapter 7.
`       8. if(x > 4) ;  <-- misplaced semicolon 
            {stuff!!!}
   d. Homework
        5.1 page 213 #1-8 all
        5.2 page 223 #1-12 all
        5.3 page 231 #1-3 all
        5.4 page 249 #1-7 all
        5.5 page 257 #1-7 all
        5.6 none(assertions)
        5.7 page 269 #1-6 all
        Chapter 5 Vocabulary p279(24 words)
        chapter 5 Review exercises #1-19 all
   e. Chapter tests & Quizzes

 Go back    to chapter 4. . . .

 Go forward to chapter 6. . . .

 Go back to Computer Science page. . . .