1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Shtirlitz [24]
4 years ago
11

Consider the following code: String word [] = {"algorithm", "boolean", "char", "double"}; for ( int i =0; i < word.length/2;

i++) { word[i] = word[word.length - 1 - i]; } What is stored in word after running this code? algorithm algorithm algorithm algo
Computers and Technology
2 answers:
KiRa [710]4 years ago
8 0

Answer:

{"double", "char", "char", "double"} will be stored in word.

Explanation:

Given the word is an array of four strings,  {"algorithm", "boolean", "char", "double"}. Hence, the length of the word array is 4.

The for-loop will only run for two iterations due to i < word.length/2, with i = 0 (first loop) and i = 1 (second loop).

In the first loop,  

  • word[word.length - 1 - i]  =  word[4 - 1 - 0]  = word[3]  = "double"
  • Hence, the string "double" will be assigned to word[0] and overwrite "algorithm"

In the second loop,

  • word[word.length - 1 - i]  =  word[4 - 1 - 1]  = word[2]  = "char"
  • Hence, the string "char" will be assigned to word[1] and overwrite "boolean"

At last, the word array will hold {"double", "char", "char", "double"}

omeli [17]4 years ago
5 0

Answer:

At the end of this code word array will hold {"double","char","char","double"}

Explanation:

  • The string word is an array of four strings {"algorithm","boolean","char","double"}.
  • This means that the length of this array is 4.
  • The for runs for half the length of array i.e. 2.

First Loop: (i = 0)

  • For i = 0 word[0] = word[word.length - 1 - 0]
  • Now here we will have word[0] = word [3] which is "double"

Second Loop (i = 1)

  • For i = 1 word[1] = word[word.length - 1 - 1]
  • Now here we will have word[1] = word [2] which is "char"

Rest of the array will remain the same hence the output will be:

word[] = {"double","char","char","double"}

You might be interested in
Bulleted and Numbered List button appear in the ………….. Toolbar.​
stich3 [128]

Answer:

The answer to this question is given below in the explanation section

Explanation:

Bulleted and Numbered List button appear in the <u>Paragraph </u>Toolbar.​

On word processing software, these options display in paragraph toolbar in the Home ribbon.

for example, in MS Word, you can find them in the Home tab under paragraph groups of command.

however, it is noted that these options are appear in some other software under the formating toolbar.

8 0
4 years ago
Suppose that a laptop identifies its processor as follows: AMD’s A84500M. What does the AMD represent?
zalisa [80]

Answer:

Advanced Micro Devices

Explanation:

4 0
3 years ago
Which of the following trims would be used at the beginning of a scene?
Ad libitum [116K]

Answer: a i think

Explanation:

6 0
3 years ago
Which type of game controller has a set of controls for each hand?
svet-max [94.6K]
If you play the Wii, they have the controller and then they have a nunchuck that connects to the other controller, and you use that with your other hand. Hope that helps :)
6 0
3 years ago
___ CRM systems use social media technology and services to enable organizations to engage their customers in a collaborative co
seraphim [82]

Answer:

The correct answer for the given question is social.

Explanation:

Social CRM is used the social media services  technique to busy her client for the organization.

Social CRM is an "customer relationship management " CRM.

Social CRM managing the information of customer data.

Social CRM increases the sales in the organization.

8 0
3 years ago
Other questions:
  • How many degrees of freedom does any unconstrained object have in 3-D modeling?
    6·1 answer
  • Do questions have to be about school work on this website or can they be questions about video games?
    11·2 answers
  • Is this statement true or false?
    13·1 answer
  • What are the two basic steps in communication
    9·1 answer
  • Data are sent through a network on bundles called ____packets____. select one:
    14·2 answers
  • Write a program that implements the FIFO and LRU page-replacement algorithms learned in class. First, generate a random page ref
    9·1 answer
  • Anyone understand coding? Please Help! Thank you! :)
    8·1 answer
  • In online advertising, the term "impression" refers to: the Web site displayed when a user clicks on an advertisement. the measu
    11·1 answer
  • Which type of chart or graph uses vertical bars to compare data? a Column chart b Line graph c Pie chart d Scatter chart
    14·2 answers
  • When a file is used by a program, there are three steps that must be taken:
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!