Question

In: Computer Science

1. What will print? int[][] numbers = { { 1, 2, 3, 4 },{ 5, 6,...

1. What will print?
int[][] numbers = { { 1, 2, 3, 4 },{ 5, 6, 7, 8 },{ 9, 10, 11, 12 } };
System.out.println(numbers[1][3]);

a) 13

b) 4

c) 8

d) 12

2. With what value does currYear = yearsArr[2] assign currYear?
int[ ] yearsArr = new int[4];
yearsArr[0] = 1999;
yearsArr[1] = 2012;
yearsArr[2] = 2025;         

a) 4

b) 1999

c) 2012

d) 2025

3. What will print?
String [][] names = { { "Elliot", "Darlene", "Angela", "Tyrell" },
{ "Joanna", "Phillip", "Tomero", "Trenton" },
{ "Mobley", "Whiterose", "Cisco", "Leon", "Mr. Robot" } };
System.out.println(names[2][4]);

a) Elliot

b) Angela

c) Joanna

d) Mr. Robot

4. What will print?
int[][] myNumbers = { {1, 2, 3, 4}, {5, 6, 7, 8}, {1, 2, 3, 4} };
int x = myNumbers[2][2];
System.out.println(x);

a) 5

b) 3

c) 7

d) 8

5. What will print?
int[][] myNumbers = { {1, 2, 3, 4}, {5, 6, 7, 8} };
int x = myNumbers[1][2];
System.out.println(x);

a) 5

b) 3

c) 7

d) 8

Solutions

Expert Solution

1)int[][] numbers = { { 1, 2, 3, 4 },{ 5, 6, 7, 8 },{ 9, 10, 11, 12 } };
System.out.println(numbers[1][3]);

a) 13

b) 4

c) 8(answer)

d) 12

2)With what value does currYear = yearsArr[2] assign currYear?
int[ ] yearsArr = new int[4];
yearsArr[0] = 1999;
yearsArr[1] = 2012;
yearsArr[2] = 2025;         

a) 4

b) 1999

c) 2012

d) 2025

3)What will print?
String [][] names = { { "Elliot", "Darlene", "Angela", "Tyrell" },
{ "Joanna", "Phillip", "Tomero", "Trenton" },
{ "Mobley", "Whiterose", "Cisco", "Leon", "Mr. Robot" } };
System.out.println(names[2][4]);

a) Elliot

b) Angela

c) Joanna

d) Mr. Robot

4) What will print?
int[][] myNumbers = { {1, 2, 3, 4}, {5, 6, 7, 8}, {1, 2, 3, 4} };
int x = myNumbers[2][2];
System.out.println(x);

a) 5

b) 3

c) 7

d) 8

5)What will print?
int[][] myNumbers = { {1, 2, 3, 4}, {5, 6, 7, 8} };
int x = myNumbers[1][2];
System.out.println(x);

a) 5

b) 3

c) 7

d) 8


Related Solutions

QUESTION 5 What is printed? int[] aArray = {1, 2, 3, 4}; int[] bArray = {5,...
QUESTION 5 What is printed? int[] aArray = {1, 2, 3, 4}; int[] bArray = {5, 6, 7, 8}; bArray = aArray; System.out.print(bArray[2]); 1 points    QUESTION 6 What is printed? public static void main(String[] args) { int[] aArray = { 1, 2, 3, 4 }; System.out.print(aArray[2]); int i = aMeth(aArray); System.out.print(i + "" + aArray[2]); } public static int aMeth(int[] iArray) { for (int i = 0; i < iArray.length; i++) { iArray[i]++; } int[] bArray = { 5,...
ID X Y 1 2 3 2 3 6 3 4 6 4 5 7 5...
ID X Y 1 2 3 2 3 6 3 4 6 4 5 7 5 8 7 6 5 7 7 6 7 8 8 8 9 7 8 10 12 11 Test the significance of the correlation coefficient. Then use math test scores (X) to predict physics test scores (Y).  Do the following: Create a scatterplot of X and Y. Write the regression equation and interpret the regression coefficients (i.e., intercept and slope). Predict the physics score for each....
[4 5 5 2 4 4 6 3 3 7 5 3 6 3 4 4...
[4 5 5 2 4 4 6 3 3 7 5 3 6 3 4 4 6 5 4 5 3 7 5 5 4 2 6 5 6 6] This is my dataset Find mean, median, mode, variance, standard deviation, coefficient of variation, range, 70th percentile, 3rdquartile of the data and skewness and define what each of these statistics measure. For example, mean is a measure of the central tendency, what about the rest? Use Chebyshev’s rule to find...
[4 5 5 2 4 4 6 3 3 7 5 3 6 3 4 4...
[4 5 5 2 4 4 6 3 3 7 5 3 6 3 4 4 6 5 4 5 3 7 5 5 4 2 6 5 6 6] This is my dataset Split the dataset in two equal parts. You have 30 datavalues. If you split the data in two equal parts each part will contain 15 data values.  Call the first part Y and second part X.Draw scatter plot of the 2 datasets, X being on the horizontal...
Write a Python program that has a list of 5 numbers [2, 3, 4, 5, 6)....
Write a Python program that has a list of 5 numbers [2, 3, 4, 5, 6). Print the first 3 elements from the list using slice expression. a. Extend this program in a manner that the elements in the list are changed to (6, 9, 12, 15, 18) that means each element is times 3 of the previous value. b. Extend your program to display the min and max value in the list.
tens Units 1 5 2 3 4 8 5 2 5 6 9 6 1 3...
tens Units 1 5 2 3 4 8 5 2 5 6 9 6 1 3 5 4 7 9 7 0 0 4 5 6 9 9 8 1 3 5 6 8 9 9 0 1 2 3 5 9 The table represent a random sample of 31 test scores taken from a large lecture class. Find the following [round to 2 decimal points X. XX] a) [2 pts] Find the 5 number summary [L, Q1, Q2, Q3,...
Matrix A2= [1 2 3; 4 5 6; 7 8 9; 3 2 4; 6 5...
Matrix A2= [1 2 3; 4 5 6; 7 8 9; 3 2 4; 6 5 4; 9 8 7] Note: TA2 is defined to be a linear transformation that maps any vector x to A2* x. That is TA2 = A2*x. Also the range of the Linear transformation represented by A2 is the same as the column space of A2. l) Find a basis for the null(TA2). m) Find nullity of A2, TA2 and A2tA2. n) Find rank(A2), rank(A2t),...
X 1 3 5 3 4 4 Y 2 5 4 3 4 6 A: Plot...
X 1 3 5 3 4 4 Y 2 5 4 3 4 6 A: Plot the date B: find the line of best fit C: determine ŷ AT x=3 D: Find r and r^2 E: explain r and r^2
2. Consider functions f : {1, 2, 3, 4, 5, 6} → {1, 2, 3, 4,...
2. Consider functions f : {1, 2, 3, 4, 5, 6} → {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}. (a) How many of these functions are strictly increasing (i.e. f(1) < f(2) < f(3) < f(4) < f(5) < f(6))? Hint: How many different possibilities are there for the range of f? For each range of f, how many strictly increasing functions are there? (b) How many of these functions are non-decreasing (i.e. f(1) ≤ f(2) ≤...
1. A three-digit number is formed from nine numbers (1, 2, 3, 4, 5, 6, 7,...
1. A three-digit number is formed from nine numbers (1, 2, 3, 4, 5, 6, 7, 8 & 9). No number can be repeated. How many different three-digit numbers are possible if 1 and 2 will not be chosen together? Select one: A. 672 B. 210 C. 462 D. 336 2. In a recent survey conducted by a professor of UM, 200 students were asked whether or not they have a satisfying experience with the e-learning approach adopted by the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT