Search Header Logo
Nested Iteration

Nested Iteration

Assessment

Presentation

Computers

9th - 12th Grade

Practice Problem

Easy

Created by

Katherine Valenti

Used 1+ times

FREE Resource

96 Slides • 5 Questions

1

Nested Iteration

2

Students will be able to...

  • Explain how nested iteration works and when to use it

  • Use nested for loops to create patterns and tables

  • Modify nested loops to change output structure and formatting

  • Implement nested iteration to analyze strings and character frequency

  • Trace and debug code that uses nested iteration

3

Warm Up

4

Open Ended

Have you ever seen a pattern of stars, numbers, or shapes in a triangle or rectangle? How do you think a program could build that pattern?

5

Warm Up

  • Print one part at a time inside of a loop

  • Repeat that pattern in another loop

6

Open Ended

If you needed to build a table or grid in code, how do you think you could do it?

7

Warm Up

  • Use a loop inside of another loop

    • One for rows

    • One for columns

8

Open Ended

What do you think would happen if you put one loop inside another loop?

9

Warm Up

  • The inner loop runs all the way through each time

  • The outer loops runs once

10

media

11

media

12

media

13

media

14

media

15

media

16

media

17

media

18

media

19

media

20

media

21

media

22

media

23

media

24

media

25

media

26

media

27

media

28

media

29

media

30

media

31

media

32

media

33

media

34

media

35

media

36

media

37

media

38

media

39

media

40

media

41

media

42

media

43

media

44

media

45

media

46

media

47

media

48

media

49

media

50

media

51

media

52

media

53

media

54

media

55

media

56

media

57

media

58

media

59

media

60

media

61

media

62

media

63

media

64

media

65

media

66

media

67

media

68

media

69

media

70

media

71

media

72

media

73

media

74

media

75

media

76

media

77

media

78

media

79

media

80

media

81

media

82

media

83

media

84

media

85

media

86

media

87

media

88

media

89

media

90

media

91

media

92

media

93

media

94

media

95

media

96

media

97

media

98

Warm Up

99

Match

Match the following concepts:

A loop written inside of another loop

Repetition of instructions a specified number of times or until a condition is met

Controls the number of full cycles through a loop

Runs completely for each cycle through a loop

Orientation of output in nested structures

Nested Loop

Iteration

Outer Loop

Inner Loop

Row vs. Column

100

Open Ended

What is the main difference between what the outer loop and the inner loop do?

101

Wrap Up

  • Outer Loop- creates the structure (ex. rows)

  • Inner Loop- Fills in each part (ex. columns)

Nested Iteration

Show answer

Auto Play

Slide 1 / 101

SLIDE