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

Question 11 pts Data in a table or a matrix can be represented using a _____ arr

ID: 3811672 • Letter: Q

Question

Question 11 pts

Data in a table or a matrix can be represented using a _____ array.

(Hint: Please use the wording from the book.)

Flag this Question

Question 21 pts

Which of the following is the correct way to create a two-dimensional array of 5-by-4 char values.

Flag this Question

Question 31 pts

How many rows are in the following two-dimensional array?

int[][] matrix = new int[10][5];

Flag this Question

Question 41 pts

How many columns are in the following two-dimensional array?

String[][] phrases = new String[5][4];

Flag this Question

Question 51 pts

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

Using the above array declaration, how would we display the value of 7?
We would enter: System.out.println(numbers[  ][ ]);

Flag this Question

Question 61 pts

A ____ array is a type of two-dimensional array that has rows of different lengths.

Flag this Question

Question 72 pts

Which of the following statements are valid? (Choose all the apply.)

Flag this Question

Question 8

When passing a two-dimensional array to a method, the ___ of the array is passed to the method.

(Hint: Please use the textbook wording.)

char letters[][] = new char[5][4]

Explanation / Answer

Question 1   1 pts
Data in a table or a matrix can be represented using a _____ array.
Answer two-dimensional

Question 2   1 pts
Which of the following is the correct way to create a two-dimensional array of 5-by-4 char values.
a) char letters[][] = new char[5][4]
b)   char letters[][] = new char[5,4];
c)   char[][] letters = new char[5][4];
d)   char[ , ] letters = new char[5,4];
e)   char[][] letters = new char[5,4];

Answer- c
       char[][] letters = new char[5][4]; (Explanation- option would be correct if there was semicolon present)

Question 3   1 pts
How many rows are in the following two-dimensional array?
int[][] matrix = new int[10][5];

Answer- There are 10 rows in the above array

Question 4   1 pts
How many columns are in the following two-dimensional array?
String[][] phrases = new String[5][4];

Answer- There are 4 columns in the above array.

Question 5   1 pts
int[][] numbers = {{1,2,3},{4,5,6},{7,8,9}};
Using the above array declaration, how would we display the value of 7?
We would enter: System.out.println(numbers[ 2 ][ 0 ]);

Answer- 7 has the index 2,0.

Question 6   1 pts
A ____ array is a type of two-dimensional array that has rows of different lengths.

Answer- ragged array


Question 7       2 pts
Which of the following statements are valid? (Choose all the apply.)
a)   int[][] r = new int[2];
b)   int[] x = new int[];
c)   int[][] y = new int[3][];
d)   int[][] z = {{1,2}};
e)   int[][] m = {{1,2},{2,3}};
f)   int[][] n = {{1,2},{2,3},};

Answer - valid statements are option c,d,e,f
  
Question 8
When passing a two-dimensional array to a method, the ___ of the array is passed to the method.
(Hint: Please use the textbook wording.)

Answer- reference

Note: Feel free to ask question in case of any doubt. God bless you!!

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