ARR - Enhanced for Loop for Arrays (Lesson)

APCompSci_LessonTopBanner.png

Enhanced for Loop for Arrays

Introduction

Array Loop Challenge

  • Create an array of ints that will hold each integer in your phone number.
  • Loop through the array and calculate the average of the ints.
  • Return the average

Then….

  • Try to rewrite your loop without using the array index.

Enhanced for Loop

Click below to learn more about Enhanced for loops.

 

Book Icon Click on "Runestone Academy" below to open the required reading that is listed.

 

Book Icon Click on "Runestone Academy" below to open the required reading that is listed.

Book Icon Access your text for this course and read what is listed below.

  • Read 5 Steps to a 5:
    • Concept 3
    • Concept 4

Array Practice

Practice Icon Practice-It! Practice

1. Go to the PracticeIt website Links to an external site..

2. Log into account.

3. Click on Start Practicing!

4. Go to the most recent edition.

5. Click on Chapter 7: Arrays

6. Complete Exercise: 7.10

Practice Icon CodingBat Practice

1. Go to the CodingBat website Links to an external site..

2. Log into your account.

3. Make sure that you are on the Java tab (not Python).

4. Select Array – 3.

5. Complete the Array-3 exercises for free response practice.

PracticeIcon.png Array Quiz Review

  1. Go to AP Classroom Links to an external site..
  2. Complete Unit 6 Progress Check(s).

Free Response Question Example

View part b to the Sound 2011 Free Response Question. This activity is required to complete your Discussion for this module.

FRQ2_EnhancedforLoopforArrays.png 

Write your own solution to this method. You will need your answer to complete the discussion assignment for this lesson.

APCompSci_LessonBottomBanner.pngIMAGES CREATED BY GAVS