Chapter 9:  pages 433 to 435

1.        What three things must be specified in order to define an array?

       Use the following array definition to answer questions 2-7.

      char characters[15];

2.        What is the index of the first array element?

3.        What is the index of the last array element?

4.        Write a statement that will place the character ‘Z’ in the third cell of the array.

5.        Write a statement that will display the last array element.

6.        Write the code necessary to fill the array from keyboard entries.  Make sure to prompt the user before each character entry.

7.        Write a loop that will display all the array elements vertically on the screen.

8.        Show the contents of the following array:

 int intergers[5] = {1, 2, 3};

9.        Show the contents of the following array:

char characters[5] = {‘C’, ‘+’,’+’};

10.     What is wrong with the following C-string array definition?
  char OOPs[3] = “C++”;
 
How would you correct the problem in this definition?

11.     True or false: Strings cannot be used in a C++ program without the string class.

12.     What is wrong with the following array definition?
 int numbers[4] = {0, 1, 2, 3, 4};

13.     Given the following array definition,
 int values[10];
 write a statement to place the product of the first and second array elements in the last element position.