Search Header Logo

B4 - Two-dimensional Arrays

Authored by Ahmetcan türk

Other

University

Used 50+ times

B4 - Two-dimensional Arrays
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

30 sec • 1 pt

Examine the following:

double[][] values =

{ {1.2, 9.0, 3.2},

{9.2, 0.5, 1.5, -1.2},

{7.3, 7.9, 4.8} } ;

what is in values[2][1] ?

7.3

7.9

9.2

There is no such array element.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Examine the following:

double[][] values =

{ {1.2, 9.0, 3.2},

{9.2, 0.5, 1.5, -1.2},

{7.3, 7.9, 4.8} } ;

what is in values[3][0] ?

7.3

7.9

9.2

There is no such array element.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

You want to create a table that looks like:

Which of the following will work?

double[][] table =

{ 12, -9, 8,

7, 14,

-32, -1, 0} ;

double[][] table =

{ {12, -9, 8},

{7, 14, 0},

-32, -1, 0} };

double[][] table =

{ {12, -9, 8}

{7, 14}

{-32, -1, 0} };

double[][] table =

{ {12, -9, 8},

{7, 14},

{-32, -1, 0} };

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Given the following:

double[][] things =

{ {1.2, 9.0},

{9.2, 0.5, 0.0},

{7.3, 7.9, 1.2, 3.9} } ;

What is the value of things.length ?

2

3

4

9

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Given the following:

double[][] things =

{ {1.2, 9.0},

{9.2, 0.5, 0.0},

{7.3, 7.9, 1.2, 3.9} } ;

What is the value of things[2].length ?

2

3

4

9

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Given the following:

long[][] stuff ;

Which of the following statements constructs an array with 5 rows of 7 columns each and assign its reference to stuff ?

stuff = new stuff[5][7] ;

stuff = new long[5][7] ;

stuff = long[5][7] ;

stuff = long[7][5] ;

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Given the following:

int[][] items =

{ {0, 1, 3, 4},

{4, 3, 99, 0, 7 },

{3, 2} } ;

Which of the following statements replaces the 99 with 77?

items[1][2] = 77;

items[2][1] = 77;

items[ 99 ] = 77;

items[2][3] = 77;

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?