01969_PPT_ch04 - Programming Logic and Design Fifth...

Info iconThis 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
Background image of page 1

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

View Full DocumentRight 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
Background 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
Background image of page 3

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

View Full DocumentRight 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
Background 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
Background image of page 5

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

View Full DocumentRight 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
Background 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
Background image of page 7

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

View Full DocumentRight 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
Background 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
Background image of page 9

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

View Full DocumentRight 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
Background 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
Background image of page 11

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

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

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

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

This note was uploaded on 08/18/2011 for the course COMP 230 taught by Professor Deokar during the Summer '11 term at DeVry Cincinnati.

Page1 / 50

01969_PPT_ch04 - Programming Logic and Design Fifth...

This preview shows document pages 1 - 14. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online