{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

01969_PPT_ch04 - Programming Logic and Design Fifth...

Info icon This preview shows pages 1–14. Sign up to view the full content.

View Full Document Right Arrow Icon
Programming Logic and Design Fifth Edition, Comprehensive Chapter 4 Making Decisions
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Programming Logic and Design, Fifth Edition, Comprehensive 2 Objectives Evaluate Boolean expressions to make comparisons Use the relational comparison operators Learn about AND logic Learn about OR logic Make selections within ranges
Image of page 2
Programming Logic and Design, Fifth Edition, Comprehensive 3 Objectives (continued) Learn about precedence when combining AND and OR selections Learn more about the case structure Use a decision table
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Programming Logic and Design, Fifth Edition, Comprehensive 4 Evaluating Boolean Expressions to Make Comparisons Dual-alternative (or binary ) selection structure: Provides an action for each of two possible outcomes Figure 4-1 The dual-alternative selection structure
Image of page 4
Programming Logic and Design, Fifth Edition, Comprehensive 5 Evaluating Boolean Expressions to Make Comparisons (continued) Single-alternative (or unary ) selection structure Action is provided for only one outcome Figure 4-2 The single-alternative selection structure
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Programming Logic and Design, Fifth Edition, Comprehensive 6 Evaluating Boolean Expressions to Make Comparisons (continued) Figure 4-3 Flowchart and pseudocode for overtime payroll program
Image of page 6
Programming Logic and Design, Fifth Edition, Comprehensive 7 Evaluating Boolean Expressions to Make Comparisons (continued) Figure 4-4 Pseudocode for payroll program with dental insurance determination
Image of page 7

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Programming Logic and Design, Fifth Edition, Comprehensive 8 Evaluating Boolean Expressions to Make Comparisons (continued) Boolean expression Represents only one of two states Evaluates to true or false Every decision in a computer program involves evaluating a Boolean expression Computer circuitry consists of two-state on-off switches Represented by 1 or 0 Every computer decision yields a true-false result
Image of page 8
Programming Logic and Design, Fifth Edition, Comprehensive 9 Using the Relational Comparison Operators For any two values, three types of comparisons: Two values are equal First value greater than the second value First value less than the second value Relational comparison operators Express Boolean tests Different languages use different symbols
Image of page 9

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Programming Logic and Design, Fifth Edition, Comprehensive 10 Using the Relational Comparison Operators (continued) Any logical situation can be expressed with only three types of comparisons: = , > , and < Operators >= and <= are not necessary, but make code more readable “Not equal” operator Most confusing of comparisons Most likely to be different in different languages
Image of page 10
Programming Logic and Design, Fifth Edition, Comprehensive 11 Using the Relational Comparison Operators (continued) Figure 4-5 Using a negative comparison
Image of page 11

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Programming Logic and Design, Fifth Edition, Comprehensive 12 Using the Relational Comparison Operators (continued) Figure 4-6 Using the positive equivalent of the negative comparison in Figure 4-5
Image of page 12
Programming Logic and Design, Fifth Edition, Comprehensive 13 Using the Relational Comparison Operators (continued) Table 4-1 Relational comparisons
Image of page 13

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 14
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern