Consider the following code segment, where twoD is a two-dimensional (2D) String array. The code segment is intended to display "JAVA".

System.out.print(twoD[2][1]);

System.out.print(twoD[3][2]);

System.out.print(twoD[1][1]);

Which of the following code segments properly declares and initializes twoD so that the code segment works as intended?

A) String[][] twoD = {{"V", "AV", "J"}, {"JA", "VA", "A"},

{"JA", "J", "JAV"}, {"AV", "V", "A"}};

B) String[][] twoD = {{"VA", "J", "A", "V"}, {"J", "A", "V", "A"},

{"AV", "A", "JA", "V"}};

C) String[][] twoD = {{"VA", "J", "V", "JA"}, {"J", "JA", "A", "VA"},

{"J", "VA", "A", "V"}};

D) String[][] twoD = {{"A", "VA", "J", "V"}, {"VA", "A", "JA", "V"},

{"VA", "J", "A", "V"}};

E) String[][] twoD = {{"A", "V"}, {"VA", "J"}, {"J", "A"}, {"A", "AV"}};

Answers

Answer 1

Answer:

A) String[][] twoD = {{"V", "AV", "J"}, {"JA", "VA", "A"},  {"JA", "J", "JAV"}, {"AV", "V", "A"}};

Explanation:

The code segment that would make this snippet of code work as intended would be A)

String[][] twoD = {{"V", "AV", "J"}, {"JA", "VA", "A"},  {"JA", "J", "JAV"}, {"AV", "V", "A"}};

This initializiation of array twoD would spell out JAVA with the code in the question because each of the following calls the following strings

twoD[2][1] = "J"

twoD[3][2] = "A"

twoD[1][1] = "VA"

The other options either don't have an index of 3 available or output the wrong letter sequences.


Related Questions

Write a summary of the following excerpt from “Why I Wrote 'The Yellow Wallpaper" by Charlotte Perkins
Gilman.
For many years I suffered from a severe and continuous nervous breakdown tending to melancholia--and beyond
During about the third year of this trouble I went, in devout faith and some faint stir of hope, to a noted specialist in
nervous diseases, the best known in the country. This wise man put me to bed and applied the rest cure, to which
a still-good physique responded so promptly that he concluded there was nothing much the matter with me, and
sent me home with solemn advice to "live as domestic a life as far as possible," to "have but two hours' intellectual
life a day," and "never to touch pen, brush, or pencil again" as long as I lived. This was in 1887

Answers

Answer:

Gilman felt very melancholy and was having a severe nervous breakdown. This mental state was maintained for three years, which made her look for a specialist in nervous diseases, who would examine her and help her to heal. The specialist stated that she did not have any serious illness, but that she needed to rest as long as she lived to be cured.

Explanation:

To make a summary of a text, you must rewrite the text in a reduced form, pointing out only the most important elements of the story. Therefore, anyone who reads the summary is able to understand the most important and relevant parts of the original text, even if they do not have many details of how it happened, since the details are presented only in the original text.

In sentence 15 (reproduced below), the writer wants to maintain credibility with the audience by using unbiased language.

Children are incredibly gullible when it comes to robots, as a recent study demonstrates.

Which of the following versions of the underlined text best accomplishes this goal?

A. (as it is now)

B. often the victims of robotic deception

C. particularly susceptible to robotic influence

D. so naive that they believe whatever robots tell them

E. not clever enough to outsmart robots

Answers

Answer:

C. particularly susceptible to robotic influence

Explanation:

Answer C

Correct. This version of the underlined text allows the writer to maintain credibility with the audience by using unbiased language. The writer effectively replaces the biased language in the original text with neutral, objective language that still conveys the writer’s message about children’s susceptibility to robotic influence.

Answer:

C

Explanation:

got it correct on progress check MCQ

Other Questions
There it isss plsss helpppp Please help me out you can just give me the answer! PLEASE AND THANK YOU! Is marketing hard? and it is stressful or can give you an anxiety? The most efficient first step in the process to factor the trinomial 3x-24x + 36x is : O A. factor out 3 O B. factor out 3x O C. factor out (x - 2) O D. factor out-1 please help me do it Pretend you are a member of a caste. Write a letter to a friend telling about your life in that particular caste. Describe your day and your feelings as you are forced to stay within a certain group for all of your interactions. Mention things you might like to do but cant because of your caste. BRAINLIEST FOR CORRECT ANSWER, IM FAILING SCHOOL AND NEED HELP ASAP. EVEN OFFICIAL HELP COUNTS x is 40% of 60x=?please help!! is 2/3 equal to 2/4 ? if not is it greater Dada la recta L1:x+(m+2)y=n5 pasa por el punto (1,2) y que es paralelo a la recta L2:3y=2x4. Determine m+n . Following a systematic plan for the preparation of an e-mail, memo, letter, or oral presentation will make the composition process easier and will help you create more effective business messages. The writing process for business messages includes prewriting, drafting, and revising. Which of the following are steps involved in the prewriting phase of the writing process? Check all that apply. Analyzing Drafting Anticipating Researching Adapting Editing Solve the system of equations using substitutiony=x+1x+y = 7 HELPPPP PLZZZZZZThe river is famous to the fish. The loud voice is famous to silence, which knew it would inherit the earth before anybody said so. The cat sleeping on the fence is famous to the birds watching him from the birdhouse. The tear is famous, briefly, to the cheek. The idea you carry close to your bosom is famous to your bosom .The boot is famous to the earth, more famous than the dress shoe, which is famous only to floors. The bent photograph is famous to the one who carries it and not at all famous to the one who is pictured. I want to be famous to shuffling men who smile while crossing streets, sticky children in grocery lines, famous as the one who smiled back. I want to be famous in the way a pulley is famous, or a buttonhole, not because it did anything spectacular, According to the speaker, why is the boot more famous than the dress shoe? Explain the meaning behind this statement in the poem. i just want to make sure im correct so is this correct? A standard coffee mug has a capacity of 16 fluid ounces. If Annie needs to fill 26 mugs with coffee, how many total quarts of coffee does she need? so what i did is i multiplied 16 x 26 = 416 then i divided 32 and 416 and got 13 so Annie filled 13 quarts of coffee. please tell me im correct or not. what is the domain of the function The graph for y-3.truefalsehelpp me Please help me on #5. Both parts of possible please. Thank you for helping! You deposit $500 at 6% interest annually. After 6 months, how much money will you earn? what is the worst thing you can do to a girl but they will like it 6. give the figure at the right,what is the measure of dbcA. 54b. 36C. 126D. 116