subject

Consider the following code segment. int[][] multi = new int[4][4];

for (int rows = 0; rows < 4; rows++)

{

for (int cols = 0; cols < 4; cols++)

{

if (cols == 0)

{

multi[rows][cols] = 0;

}

else if (cols == 1)

{

multi[rows][cols] = 1;

}

else if (cols == 2)

{

multi[rows][cols] = 2;

}

if ((rows % 2 == 0) && (cols % 2 == 0))

{

if ((rows >= 2) && (cols <= 2))

{

multi[rows][cols] = 9;

}

}

}

}

As a result of executing the code segment, how many elements in the two-dimensional (2D) array multi will store the value 9 ?

A) 0
B)1
C)2
D)4
E)6

ansver
Answers: 1

Another question on Advanced Placement (AP)

question
Advanced Placement (AP), 23.06.2019 16:50
Often, leaders must be honest, even when what they have to say is not appealing or positive. explain why honesty is an important leadership quality.
Answers: 1
question
Advanced Placement (AP), 25.06.2019 03:30
Why is the road most slick when it first begins to rain? a. oils the road has absorbed begin to float. b. the water has not had time to run off. c. a higher concentration of dirt makes the road more slick. d. none of the above
Answers: 1
question
Advanced Placement (AP), 25.06.2019 15:00
Ahypothesis test is conducted with a significance level of 5%. the alternative hypothesis states that more than 65% of a population is right-handed. the p-value for the test is calculated to be 0.03. which of the following statements is correct? we can conclude that more than 3% of the population is right-handed. we cannot conclude that more than 65% of the population is right-handed. we can conclude that more than 65% of the population is right-handed. we can conclude that exactly 3% of the population is right-handed. there is not enough information given to make a conclusion.
Answers: 2
question
Advanced Placement (AP), 25.06.2019 23:30
Aschool principal trying to find out if parents will buy new playground equipment shows digital leadership by
Answers: 1
You know the right answer?
Consider the following code segment. int[][] multi = new int[4][4];

for (int rows = 0;...
Questions
question
English, 25.09.2019 23:50
question
World Languages, 25.09.2019 23:50
Questions on the website: 13722363