{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

01969_PPT_ch04

# 01969_PPT_ch04 - Programming Logic and Design Fifth...

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

Programming Logic and Design Fifth Edition, Comprehensive Chapter 4 Making Decisions

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

View Full Document
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
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

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

View Full Document
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
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

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

View Full Document
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
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

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

View Full Document
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
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

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

View Full Document
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
Programming Logic and Design, Fifth Edition, Comprehensive 11 Using the Relational Comparison Operators (continued) Figure 4-5 Using a negative comparison

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

View Full Document
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
Programming Logic and Design, Fifth Edition, Comprehensive 13 Using the Relational Comparison Operators (continued) Table 4-1 Relational comparisons

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• 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.

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

• 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.

Dana University of Pennsylvania ‘17, Course Hero Intern

• 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.

Jill Tulane University ‘16, Course Hero Intern