Skip to main content

Section 9.16 Arrays-WE6-P1

Subsection 9.16.1 Subgoals for Evaluating Arrays

  1. Set up array from 0 to size-1

  2. Evaluate data type of statements against array

  3. Trace statements, updating slots as you go

    1. Remember assignment subgoals

Subsection 9.16.2 Arrays-WE6-P1

Exercises Exercises

1.

Put the following code in order to create a program that will declare and instantiate an array of 20 random values between 1 and 100 and then calculate and print the average of the first 10 numbers.

2.

Put the following code in order to create a program that will declare and instantiate an array of 20 random values between 1 and 100 and then calculate and print the average of the last n numbers.

You have attempted of activities on this page.