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
Show answers
  • Question 1
    30 seconds
    Report an issue
    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];
  • Question 2
    30 seconds
    Report an issue
    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
  • Question 3
    30 seconds
    Report an issue
    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}
  • Question 4
    30 seconds
    Report an issue
    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}
  • 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?
    answer choices
    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?

    answer choices

    Console.WriteLine(deck[18]);

    Console.WriteLine(deck[0]);

    Console.WriteLine(deck[10]);

    Console.WriteLine(deck[20]);

  • 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?

    answer choices

    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?

    answer choices

    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"?

    answer choices

    0

    1

    11

    12

Report an issue
Why show ads?
Report Ad
Enter Code