ch04notes - Chapter 4 Making Decisions At a Glance Overview...

This preview shows page 1 - 4 out of 8 pages.

Chapter 4Making DecisionsAt a GlanceOverviewObjectivesQuick QuizzesAdditional ResourcesKey Terms
Lecture NotesOverviewChapter 4 introduces relational comparison operators and the use ofANDandORlogic.Students will learn how to use these operators and what type of common mistakes they shouldavoid. Students will also learn to make selections within ranges and to understand theprecedence ofANDandORstructures.Chapter ObjectivesIn this chapter, your students will learn about:Evaluating Boolean expressions to make comparisonsThe relational comparison operatorsANDlogicORlogicMaking selections within rangesPrecedence when combiningANDandORoperatorsEvaluating Boolean Expressions to Make Comparisons1.Understand the concept of theBoolean expressionand discuss how this type ofevaluation is “natural” for a computer.2.Contrast the dual-alternative selection with the single-alternative selection using Figures4-1 and 4-2.3.Review the logic for the overtime payroll program seen in Figure 4-3.The dual-alternative structure is also known as anif-then-else, while thesingle-alternative structure is also known as anif-then.Understand thoroughly the logic and pseudocode used for the overtime paycalculation. New programming students have a great deal of trouble withalgorithm development and often will have statements in an incorrect order.Using the Relational Comparison Operators1.Understand the six relational comparison operators (Table 4-1), and these operators areused to build Boolean expressions.2.Understand the three possible ways to compare two values:a.The two values are equalb.The first value is greater than the second value
c.The first value is less than the second value3.Define the termtrivial expressionand review the examples on page 139.
4.Understand why the <= and the >= operators make code more understandable.5.Understand the need to adjust the Boolean expression and the logic based on thecomparison being used.
6.Understand the code readability issues that occur when using a “not equal” test resultsin a double negative, and describe how to rephrase the question to have a positive test.

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 8 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
N/A
Tags
Logic, Boolean Algebra, Logical conjunction, or operator

Newly Uploaded Documents

Show More

Newly Uploaded Documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture