IT - Nested Iteration (Lesson)

APCompSci_LessonTopBanner.png

Nested Iteration

Introduction

Clock A clock is a perfect example of a nested loop.

One loop would be used to keep track of the hour.

One loop would be used to keep track of the minutes.

One loop would be used to keep track of the seconds.

For each hour, the minute loop would iterate 60 times.

For each minute, the seconds loop would iterate 60 times.

Brainstorm how these three loops can be organized.

Nested Loops

Click below to begin the Nested Loop activity.

 

BookIcon.png Click on "Runestone Academy" below to open the required reading that is listed.

Runestone Academy: AP CSA – Java Review Links to an external site.

READ: 7.4 – Nested for Loops

BookIcon.png Click on "Introduction to Computer Science Using Java" below to open the required reading that is listed.

Introduction to Computer Science Using Java Links to an external site.

READ: Chapter 21: Nesting Loops and Ifs

Complete the review for practice.

 

READ: 5 Steps to a 5:

Take Diagnostic Exam

Nested Loop Stars Activity

Practice-It! Practice

Practice Icon Go to the PracticeIt website Links to an external site..

Log into account.

Click on Start Practicing!

Go to the most recent edition.

Click on Chapter 2: Primitive Data and Definite Loops.

Complete Exercises 2.4 – 2.15.

Iteration Test Review

Practice Icon Go to AP Classroom Links to an external site..

Complete Progress Check 4.

APCompSci_LessonBottomBanner.pngIMAGES CREATED BY GAVS