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

Example: String input = \"Java language\"; 2.) What is the output of the followi

ID: 3551337 • Letter: E

Question


Example: String input = "Java language";

2.)What is the output of the following program?


int[] a = new int[10];
for (int i = 0; i < a.length; i++)
{
   a[i] = 2*i;
}
for (int i = 0; i < a.length; i += 3)
{
System.out.print(a[i] + " ");
}


3.) int[][] array = { { 3, 7, 8}, {5, 1, 3}, {2, 0, 4}, {9, 1, 6}};


What value is stored in array[2][1]?



4.)The same Java array can store primitive types and reference types. T/F


5.)Given the following array


     int[] a = {5, 7 , 9, 10, 15};

What is the first element compared in the array when searching for 10 with linear search?


5.)Given the following array


     int[] a = {5, 7 , 9, 10, 15};

What is the first element compared in the array when searching for 10 with binary search?


6.)Binary Search only works properly if the array being searched is sorted. T/F


7.)Given the following 2-D array


     int[][] array = { { 3, 7, 8}, {5, 1, 3}, {2, 0, 4}, {9, 1, 6}};

How many rows does array have?


8.)Given the following 2-D array


     int[][] array = { { 3, 7, 8}, {5, 1, 3}, {2, 0, 4}, {9, 1, 6}};

What value is stored in array[2][1]?

J a v a l a n g u a g e



Explanation / Answer

Part B:

Dr Jack
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote