Professional Documents
Culture Documents
Syllabus Mid Term Exam - PF
Syllabus Mid Term Exam - PF
Chapter 4
Control Structures
Sequence , Selection , Repetition
Logical Expression and Relational Operators (==, != , < , <= , > , >=)
Relational Operators and Simple Data types
Relational Operators and String Data types
Logical Operators and Logical expression (! Not , && and , || or)
Order of Precedence
int Data Type and Logical (Boolean) Expressions
bool Data Type and Logical (Boolean) Expressions
Selection: if and if...else
One-Way Selection (if statement)
Two-Way Selection (if else)
Compound (Block of) Statements
Multiple Selections: Nested if
Comparing if...else Statements with a Series of if Statements
Short-Circuit Evaluation
Comparing Floating-Point Numbers for Equality: A Precaution
Associativity of Relational Operators: A Precaution ( if (0 <= num <= 10) )
Avoiding Bugs by Avoiding Partially Understood Concepts and Techniques (else
belongs to nearest if)
Confusion between the Equality Operator (==) and the
Assignment Operator (=)
Conditional Operator (?:)
Switch Structures
Avoiding Bugs by Avoiding Partially Understood Concepts and Techniques
(Revisited)
Terminating a Program with the assert Function
PROGRAMMING EXAMPLE: Cable Company Billing