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

Which of the following is false? All elements of the array have the same data ty

ID: 3809920 • Letter: W

Question

Which of the following is false? All elements of the array have the same data type. All elements in an array have the same name. All elements in an array have the same subscript. The first element of the array has a subscript of zero. (TCO 11) A three-row, four-column array has a total of how many elements? 7 12 16 1 (TCO 12) Given the following array: int profit [5] = {10, 20, 31, 55, 66}; The following statement would replace which value? profit (3) = profit(2 - 1); 55 with 10 31 with 10 31 with 20 55 with 20

Explanation / Answer

1) all elements of array have the same subscript. [false] because the subscript of array starts from zero and every element have a unique subscript.

3) 3-row and 4-column in array have = 3x4=12 elements.

4) int profit[5]= {10, 20, 31, 55,66}

profit[3] will be 55 as the index of

10 is 0, 20 is 1, 31 is 2, 55 is 3 and 66 is 4.

therefore profit[3]=55

profit[2-1]=profit[1]=20

so 55 is replaced with 20

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