subject

How many times will line 7 be executed when the following code is run? String str = "rebellion";

int i = 0;

int j = str. length() - 1;

String result = "";

while (i < j)

{

result = str. substring(i, i + 1) + result + str. substring(j, j + 1);

i++;

j--;

}

System. out. println(result);
(Java)

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 09:50
Allison and her group have completed the data entry for their spreadsheet project. they are in the process of formatting the data to make it easier to read and understand. the title is located in cell a5. the group has decided to merge cells a3: a7 to attempt to center the title over the data. after the merge, allison points out that it is not centered and looks bad. where would the title appear if allison unmerged the cells in an attempt to fix the title problem?
Answers: 2
question
Computers and Technology, 23.06.2019 10:50
Your friend kayla is starting her own business and asks you whether she should set it up as a p2p network or as a client-server network. list three questions you might ask to kayla decide which network to use and how her answers to those questions would affect your recommendation.
Answers: 2
question
Computers and Technology, 23.06.2019 15:30
Write a program in plp assembly that counts up by one starting from zero (or one) inside a loop and writes this value to the leds every time the value is increased. the memory address of the leds is 0xf0200000. the table below shows the meaning and an example usage of the instructions covered in the video, plp instructions for project 1. instruction example usage meaning load immediate li $t0, 8 register $t0 is set to the value, 8. store word sw $t2, 0($t1) the value in register $t1 is used as the memory address. the value in register $t2 is copied into this memory address. add addiu $t4, $t3, 29 register $t4 is assigned the sum of 29 and the value in register $t3. jump j your_label_name the program jumps to the line following the label, "your_label_name: ". label your label name: defines a label called "your_label_name: " that can be jumped to
Answers: 2
question
Computers and Technology, 24.06.2019 15:30
What is the function of compilers and interpreters? how does a compiler differ from an interpreter?
Answers: 2
You know the right answer?
How many times will line 7 be executed when the following code is run? String str = "rebellion";
Questions
question
Chemistry, 07.06.2021 23:20
question
English, 07.06.2021 23:20
question
Mathematics, 07.06.2021 23:20
question
Mathematics, 07.06.2021 23:20
question
Mathematics, 07.06.2021 23:20
Questions on the website: 13722363