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

Page Two dimensional (2D) array 1. Declare a 2D array z of 100 arrays and 5 elem

ID: 3699923 • Letter: P

Question

Page Two dimensional (2D) array 1. Declare a 2D array z of 100 arrays and 5 elements of type double in each array 2. Set the value of the 3rd element of the 90th array in array z to 88.876 3. Set the value of the Sth element of the 100th array to five times the 2nd element of the 44th array in array z 4. Display the value of the 4th element of the 55th array in array s. Use the length command to compute the index of the last array in array z 6. Use the length command to compute the index of the last glement in the 1st array in array 7. What is the output of this code? for (int x 1; x

Explanation / Answer

1. double[[] z = new double[100][5];

==========
2. z[89][2] = 88.876;
==========
3. z[99][4] = 5 * z[43][1];
==========
4. System.out.println(z[54][3]);
==========
5. System.out.println("index of last array: " + z.length - 1);
==========
6. System.out.println("index of last element in 1st array: " + z[0].length - 1);


============
7. output is
1 0
1 1
1 2
2 0
2 1
2 2
3 0
3 1
3 2


==========
8. for(int i = 0; i < 100; i++)
{
for(int j = 0; j < 5; j++)
System.out.print(z[i][j] + " ");

System.out.println();
}


  
==========


From Question 9 to 13, they are all related.
Since the question says 2D array, all elements should be of String type, but, the student Id is shown as int. Can you please check with instructor if they are all String