Control Flow

Your programs need to make decisions. Learn if-else, switch, and how to combine conditions logically.

53 lessons
210 min

Lessons

1. Intro

The Goal

4m

2. What is Control Flow?

Understanding program paths

4m

3. The if Statement

Running code conditionally

4m

4. Condition Expressions

What goes in parentheses

4m

5. Quiz: if Basics

Test understanding

3m1 problems

6. if-else Statement

Choosing between alternatives

4m

7. Choosing Between Two Options

When to use if-else

4m

8. Quiz: Conditional execution

Conditional execution

3m1 problems

9. Quiz: if-else

Test understanding

3m1 problems

10. Chained if-else

More than two paths

4m

11. else if Statement

How conditions are checked

4m

12. Quiz: Conditional execution

Conditional execution

3m1 problems

13. Order of Conditions

Why sequence matters

5m

14. Quiz: Chained Conditions

Test understanding

3m1 problems

15. Nested if Statements

Testing within branches

4m

16. When to Nest vs Chain

Choosing the right structure

4m

17. Quiz: Conditional execution

Conditional execution

3m1 problems

18. The Dangling else Problem

Which if owns the else

4m

19. Quiz: Nested if

Test understanding

3m1 problems

20. Comparison in Conditions

Testing relationships

4m

21. Combining Conditions with &&

Requiring multiple conditions

4m

22. Challenge: Grade Calculator

Multiple conditions

7m1 problems

23. Quiz: Equality check

Equality check

3m1 problems

24. Combining Conditions with ||

Alternative conditions

4m

25. Negating Conditions with !

Testing for false

4m

26. Quiz: Logical Operators

Test understanding

3m1 problems

27. The switch Statement

Choosing from constants

4m

28. switch Syntax

Structure of switch

4m

29. Quiz: Multi-way branching

Multi-way branching

3m1 problems

30. The break Keyword

Exiting the switch

4m

31. Fall-through Behavior

Intentional case sharing

4m

32. Quiz: Loop exit

Loop exit

3m1 problems

33. The default Case

Handling unexpected values

4m

34. Quiz: switch Statement

Test understanding

3m1 problems

35. switch vs if-else

Discrete value matching

4m

36. Common Condition Mistakes

Avoiding errors

4m

37. Quiz: Conditional execution

Conditional execution

3m1 problems

38. Problem - Grade Calculator

Converting scores to letters

4m1 problems

39. Problem - Simple Calculator

Four operations

4m1 problems

40. Problem - Leap Year

Multiple rules with &&

4m1 problems

41. Problem - Team

Solving problems together

4m1 problems

42. Team - The Idea

Sum and compare

4m

43. Team - Algorithm

Breaking it down

5m

44. Quiz: Knowledge check

Knowledge check

3m1 problems

45. Team - Implementation

Complete solution

7m1 problems

46. Lessons from Team

summary

4m

47. Problem - Helpful Maths

Reordering addition

4m1 problems

48. Helpful Maths - The Idea

Parse then reorder

5m

49. Helpful Maths - Algorithm

Breaking it down

4m

50. Quiz: Knowledge check

Knowledge check

3m1 problems

51. Helpful Maths - Implementation

Complete solution

7m1 problems

52. Lessons from Helpful Maths

summary

4m

53. Section Recap

What we learned

5m

Ready to start learning?

Access all 53 lessons with interactive content and progress tracking.