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 08:20
Who wants free points + brainliest? answer this question correctly and you shall receive if you're caught driving with you could be punished with up to a year in jail and be fined up to $1,000. a. a suspended driver license or license plate b. an intoxicated minor passenger c. headphones covering both ears d. a broken taillight or headlight
Answers: 1
question
Advanced Placement (AP), 23.06.2019 13:20
Iwill give anyone points if they me right now q: sustainable development is related to pollution in that a. sustainable development allows pollution to continue at current levels.b. sustainable development increases pollution of all types.c. addressing pollution is a factor in sustainable development.d. sustainable development incorporates pollution as a benefit.e. pollution levels will decrease with development.
Answers: 2
question
Advanced Placement (AP), 24.06.2019 16:00
Choose the description that best matches each word. write the correct letter in the blank. 1. ostinato a. large, extended composition for chorus and orchestra 2. atonality b. full orchestra 3. musicology c. festive, march-like opening to a play or “semi-opera” 4. concerto d. small group of solo instruments 5. minimalism e. music contrasting a full orchestra and solo instruments 6. art song f. music played under the action to influence the mood 7. strophic form g. a vocal song focusing on artistic expression 8. incidental h. each stanza of a poem is set to the same music 9. oratorio i. repeated musical pattern that provides unity to a piece 10. dissonance j. steady beat; simple harmonies; short, repetitive melody 11. concertino k. harsh, unstable sounding of pitches; harmonic tension 12. tutti l. all 12 tones of chromatic scale, no tonal center 13. entrada m. the historical and scientific study of music
Answers: 3
question
Advanced Placement (AP), 25.06.2019 06:30
You are only allowed to use tutors that your school recommends. t / f
Answers: 2
You know the right answer?
Consider the following code segment. int[][] multi = new int[4][4];

for (int rows = 0;...
Questions
question
Mathematics, 29.08.2019 15:30