 QUIZ
Arrays Intro
4 years ago by
DVHSAPCS
Save
Copy and Edit
INSTRUCTOR-LED SESSION
Start a live quiz
ASYNCHRONOUS LEARNING
Assign homework 9 questions
Preview
• Question 1
30 seconds
Report an issue
Q. Which declaration creates an array that holds 5 ints?
int hand = new int;
int hand = new int[];
int[] hand = new int;
int hand = new int;
• Question 2
30 seconds
Report an issue
Q. For the array:
double[] stats = new double;
What is the range of the index?
0 to 3
0 to 2
1 to 3
0 to 4
• Question 3
30 seconds
Report an issue
Q. //Which array will win?
string status = "Win";
if(player == 4)
status = "lose";
if(player == 3)
status = "lose";
if(player == 2)
status = "lose";
{0,1,2,3}
{1,3,2,4}
{3,2,1,4}
{3,2,4,5}
• Question 4
30 seconds
Report an issue
Q. //Which array will lose?
string status = "Win";
if(player == 4)
status = "lose";
if(player == 3)
status = "lose";
if(player == 2)
status = "lose";
{3,2,4,1}
{1,2,3,4}
{1,2,4,3}
{3,4,1,2}
• Question 5
30 seconds
Report an issue
Q. for(int i=0; i<10; i++)
numbers[i] = 2 * i + 1;
// Which index of the array holds the value of 5?
1
2
3
4
• Question 6
30 seconds
Report an issue
Q.

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

deck[2*i] = 5;

// Which statement will not print out 5?

Console.WriteLine(deck);

Console.WriteLine(deck);

Console.WriteLine(deck);

Console.WriteLine(deck);

• Question 7
30 seconds
Report an issue
Q.

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

numbers[i-1] = i/10;

//At what index will the first 2 occur?

1

2

19

20

• Question 8
30 seconds
Report an issue
Q.

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

numbers[i] = i%10;

//At what index will the first 5 occur?

4

5

49

50

• Question 9
30 seconds
Report an issue
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"? 