Professional Documents
Culture Documents
Problem Solving
(CSC415)
by
PUAN AFIZA ISMAIL
Faculty of Computer & Mathematical Sciences
UiTM MALAYSIA
1
Selection Structures
Chapter 4
2
Contents
4.1 Introduction
4.2 Selection criteria with Boolean expression
4.3 The if statement
4.4 The if..else statement
4.5 Nested if statement / if..else chain
4.6 The switch statement
Relational operators:
Allow comparisons
Require two operands
Return 1 if expression is true, 0 otherwise
if final_score >= 60
status = pass
else
status = fail
pair
pair
pair
pair