Selections
Lecture-8
Instructors
Ms.Huma Nisar
, Lecture Outline
• Nested if statement
• Multi-way if-else if-else statement
• Logical Operators
• Conditional Expressions
, Nested Decision Structures
An if statement can be inside another if statement to form a nested if statement
• Example:
– Determine if someone qualifies for a loan, they must meet
two conditions:
• Must earn at least $30,000/year
• Must have been employed for at least two years
– Check first condition, and if it is true, check second
condition
, Nested Decision Structures – Example
4