array worksheet #1 Name -
  Day of Week -

1. (True/False) You must declare an array in order to access individual values within the array.
2. (True/False) You must initialize an array in its declaration statement.
3. (True/False) If an array is declared with ten elements, the elements have index (subscript) positions 1 through 10.
4. (True/False) C++ allows you to declare arrays of integers.
5. (True/False) Each number stored in an array is called an index.

6. Write a declaration statement that declares an array of int's named numbers that can hold 5 numbers.

 

7. Write a declaration statement that declares an array of int's named numbers & initializes it with the specific values 23, 14, 85, 0, 3 (in that order).

 

8. Write an assignment statement that assigns the third element of an array named numbers to the value 34. Note that I consider the very first element of numbers is considered to be in index position zero.

 

9. Write a statement that displays the value stored as the fourth element of the array numbers to the screen. Note that I consider the very first element of numbers is considered to be in index position zero.

 

10. Write a complete program that declares an array of five integer elements named numbers. Using a for loop, assign the value 10 to each element of numbers.












11. On the back of this paper, write a complete program that allows the user to enter five integers which are stored into an array named numbers. Also, use a for loop to find and display the sum of the elements in the array.