CS 7643 QUIZ 2 ESSENTIAL MACHINE
LEARNING CONCEPTS REVIEW
◉01
12
2 3.
Answer: After the following statements execute, what are the
contents of matrix?
int matrix[3][2];
int j, k;
for (j = 0; j < 3; j++)
for (k = 0; k < 2; k++)
matrix[j][k] = j + k;
◉ True.
Answer: T/F?
All components of an array are of the same data type.
, ◉ False.
Answer: T/F?
Arrays can be passed as parameters to a function by value, but it is
faster to pass them by reference.
◉ 0 through 99.
Answer: Assume you have the following declaration char
nameList[100];. Which of the following ranges is valid for the index
of the array nameList?
◉ 0 through 999.
Answer: Assume you have the following declaration double
salesData[1000];. Which of the following ranges is valid for the index
of the array salesData?
◉ beta[0].
Answer: Assume you have the following declaration int beta[50];.
Which of the following is a valid element of beta?
a. beta['2']
b. beta['50']
LEARNING CONCEPTS REVIEW
◉01
12
2 3.
Answer: After the following statements execute, what are the
contents of matrix?
int matrix[3][2];
int j, k;
for (j = 0; j < 3; j++)
for (k = 0; k < 2; k++)
matrix[j][k] = j + k;
◉ True.
Answer: T/F?
All components of an array are of the same data type.
, ◉ False.
Answer: T/F?
Arrays can be passed as parameters to a function by value, but it is
faster to pass them by reference.
◉ 0 through 99.
Answer: Assume you have the following declaration char
nameList[100];. Which of the following ranges is valid for the index
of the array nameList?
◉ 0 through 999.
Answer: Assume you have the following declaration double
salesData[1000];. Which of the following ranges is valid for the index
of the array salesData?
◉ beta[0].
Answer: Assume you have the following declaration int beta[50];.
Which of the following is a valid element of beta?
a. beta['2']
b. beta['50']