Search Header Logo

Unit 8 Review

Authored by Karen Shih

Mathematics

12th Grade

Used 2+ times

Unit 8 Review
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

5 mins • 1 pt

Which of the following correctly represents the number of items in a 2D array called 'matrix'?

matrix.length - matrix[0].length - 1

matrix.length - matrix[0].length

matrix.length * matrix[0].length

matrix[0].length - matrix.length

2.

MULTIPLE CHOICE QUESTION

5 mins • 1 pt

Which of the following represents the correct nested loop headers to traverse through a 2D array called "table" of String values?

for (String row : table){ for(String str : row){

for (String[] row : grid){ for(String str : row){

for(String[][]row:table){

  for (String[] str :row){

for (String[] row : grid){

  for(String[] str : row){

3.

MULTIPLE CHOICE QUESTION

5 mins • 1 pt

Which of the following statements puts the word "answer" into a 5x5 array of strings at the 2nd column and 4th row?

String[3][1] = "answer"

String[2][4] = "answer"

String[1][3] = "answer"

String[4][2] = "answer"

4.

MULTIPLE CHOICE QUESTION

5 mins • 1 pt

Which of the following represents the correct way to create a two-dimensional array of strings?

  1. I. String[][] values = new String[][];

  2. II. String[][] values = new [{“A”, “B”}][{“C”, “D”}];

  3. III. String[][] values = {{“A”, “B”}, {“C”, “D”}};

I and III only

I and II only

III only

II only

5.

MULTIPLE CHOICE QUESTION

5 mins • 1 pt

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

What is the value of x after the statement has executed?

int x = nums[2][1] * nums[1][2]+nums[0][1] / nums[0][3];

44

-18

-4

24

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

int[][] data = new int[4][7];

Which of the following correctly assigns the third row of the table to the numbers 1 through 7?

for(int i = 0; i <= 6; i++) {

data[i][3] = i + 1;

}

for(int i = 1; i <= 7; i++) {

data[2][i-1] = i;

}

for(int i = 0; i <= 6; i++) {

data[i-1][i] = i + 1;

}

for(int i = 0; i <= 7; i++){

    data[2][i] = i;

}

7.

MULTIPLE CHOICE QUESTION

5 mins • 1 pt

int[][] grid = new int[10][10];

Which of the following code snippets will fill a grid with a multiplication table with multiples of 1 to 10?

for(int a=0;a<grid[0].length; a++) {

for(int b=0;b<grid.length;b++){

grid[a][b] = a * b; }}

for(int a = 0; a < grid.length; a++) { for(int b = 1; b < grid.length; b++) { grid[a+1][b+1] = a * b; }}

for(int a=0;a<grid.length;a++){

for(int b=0;b<grid[0].length; b++){

grid[a][b]=(a+1)*(b+1); }}

for(int a=1;a<grid.length; a++){

    for(int b=1;b<grid[0].length; b++){

        grid[a][b] = a * b;}}

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?