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

Question 1 True/False: The following statement initializes all five elements of

ID: 3725990 • Letter: Q

Question

Question 1

True/False: The following statement initializes all five elements of the number array to 1.

int number[5] = {1};

True

False

QUESTION 2

Unlike regular variables, arrays can hold multiple ________.

variables

data types

named constants

operators

values

QUESTION 3

True/False: The following statement adds a new element to a the department vector at index 25.
department.push_back(25);

True

False

  

QUESTION 4

When an array is passed to a function, it is actually ________ the array that is/are passed.

the value stored in the first element of

the starting memory address of

the data type and name of

the data type and size of

a copy of all the values in

  

QUESTION 5

To step through a one-dimensional array, accessing the elements one by one, it would be most appropriate to use ________ loop.

a for loop

a sentinel controlled loop

no

an infinite

a nested loop

QUESTION 6

The statement
  int grades[ ] = { 100, 90, 99, 80 };
is an example of ________.

an illegal array initialization

data encapsulation

implicit array sizing

default arguments

an illegal array declaration

variables

data types

named constants

operators

values

Explanation / Answer

Question 1

The following statement initializes all five elements of the number array to 1.

int number[5] = {1};

Answer: - True

Question 2

Unlike regular variables, arrays can hold multiple

Answer: - Values

Question 3

The following statement adds a new element to the department vector at index 25.
department.push_back(25);
Answer: - False

Question 4

When an array is passed to a function, it is actually ________ the array that is/are passed.

Answer: - the starting memory address of

Question 5

To step through a one-dimensional array, accessing the elements one by one, it would be most appropriate to use ________ loop.

Answer: - a for loop

Question 6

The statement  int grades[ ] = { 100, 90, 99, 80 }; is an example of ________.

Answer: - implicit array sizing

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote