Computers

9th -

12th grade

Image

Arrays Intro

1.2K
plays

12 questions

Show Answers
See Preview
1. Multiple-choice
30 seconds
Q. Which declaration creates an array that holds 5 ints?
answer choices
int[5] hand = new int[5];
int[5] hand = new int[];
int[] hand = new int[5];
int hand = new int[5];
2. Multiple-choice
30 seconds
Q. For the array:
double[] stats = new double[3];
What is the range of the index?
answer choices
0 to 3
0 to 2
1 to 3
0 to 4
3. Multiple-choice
30 seconds
Q. //Which array will win?
string status = "Win";  
if(player[3] == 4)          
  status = "lose";
if(player[1] == 3)            
  status = "lose";
if(player[2] == 2)            
  status = "lose";
answer choices
{0,1,2,3}
{1,3,2,4}
{3,2,1,4}
{3,2,4,5}
4. Multiple-choice
30 seconds
Q. //Which array will lose?
string status = "Win";
if(player[3] == 4)          
  status = "lose";
if(player[1] == 3)          
  status = "lose";
if(player[2] == 2)          
  status = "lose";
answer choices
{3,2,4,1}
{1,2,3,4}
{1,2,4,3}
{3,4,1,2}
5. Multiple-choice
30 seconds
Q. for(int i=0; i<10; i++)
           numbers[i] = 2 * i + 1;
// Which index of the array holds the value of 5?
answer choices
1
2
3
4
6. Multiple-choice
30 seconds
Q. 

for(int i=0;i<10;i++)

deck[2*i] = 5;

// Which statement will not print out 5?

answer choices

Console.WriteLine(deck[18]);

Console.WriteLine(deck[0]);

Console.WriteLine(deck[10]);

Console.WriteLine(deck[20]);

7. Multiple-choice
30 seconds
Q. 

for(int i = 1; i<=100; i++)

numbers[i-1] = i/10;

//At what index will the first 2 occur?

answer choices

1

2

19

20

8. Multiple-choice
30 seconds
Q. 

for(int i = 1; i<=100; i++)

numbers[i] = i%10;

//At what index will the first 5 occur?

answer choices

4

5

49

50

9. Multiple-choice
30 seconds
Q. 

//cArray is filled with "c"s.

for(int i=1;i<100;i++)

if(i<11)

cArray[i] = "d";

//At what index will cArray

have its first "c"?

answer choices

0

1

11

12

10. Multiple-choice
30 seconds
Q. 

Which is correct declaration of a 2D array with 5 rows and 2 columns?

answer choices

int [,] arrayTwoDee = new int [ 2 , 5 ];

int [,] arrayTwoDee = new int [ 5 , 2 ];

int [,] arrayTwoDee = new int [ 5 ; 2 ];

int [,] arrayTwoDee = new int [ 2 . 5 ];

11. Multiple-choice
30 seconds
Q. 

Given this line: int[,] skateboards = { {80, 45}, {25, 10} }; What are the coordinates of 45?

answer choices

skateboards[1,1];

skateboards[0,1];

skateboards[0,0];

skateboards[1,0];

none of these

12. Multiple-choice
30 seconds
Q. 

Which array represents int[,] subject = new int[3, 2]; ?

answer choices

int[,] subject = { {20,18}, {13, 15}};

int[,] subject = { {20,18,13} , {15, 17, 23}};

int[,] subject = { {20,18}, {13, 15}, {17, 23} ;

int[,] subject = { {20,18}, {13, 15}, {17, 23} };

Quizzes you may like

Quiz image
12 Qs

Imaginary & Complex Numbers

179 plays
9th - 
11th  
Quiz image
14 Qs

Blends

484 plays
KG - 
5th  
Quiz image
14 Qs

Data Types in Python

519 plays
1st - 
5th  
Quiz image
15 Qs

Adding and Subtracting Radical Expressions

136 plays
7th - 
9th  
Quiz image
15 Qs

Java Array

406 plays
10th  
Quiz image
10 Qs

Distance Between Points on the Coordinate Plane

904 plays
8th - 
11th  
Quiz image
10 Qs

Quadratic Formula

515 plays
9th - 
10th  
Quiz image
15 Qs

Java Variables

723 plays
9th - 
12th  
library
create
reports
classes