Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Write array declarations for each of the following: a. Six grade point averag

ID: 3691920 • Letter: 1

Question

1. Write array declarations for each of the following:

a. Six grade point averages.

b. Seven last names.

c. 10 ages.

2. Declare and initialize arrays that store the following:

a. The whole numbers 2, 4, 6, 8, 10

b. The last names Carlson, Matthews, and Cooper

c. The prices 15.00, 122.00, and 7.50

3. Write an assignment statement that assigns the value 32 to the first element of thearray of integers named customerNumber .

4. An array of int s named numbers is stored at memory location 4000. Where is numbers[1] ? Where is numbers[4] ?

Explanation / Answer

1.
(a)
double gpa[6];
(b)
string lastName[7];
(c)
int age[10];

2.
(a)
int whole[] = {2, 4, 6, 8, 10};
(b)
string lastName[] = {Carlson, Matthews, and Cooper};
(c)
double prices[] = {15.00, 122.00, 7.50};

3.
customerNumber[0] = 32;

4.
numbers[1] will be at location 4000 + (4 * 1) = 4004
numbers[4] will be at location 4000 + (4 * 4) = 4016