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
sashaice [31]
3 years ago
9

What is stored in str after the following code executes?

Computers and Technology
1 answer:
uranmaximum [27]3 years ago
6 0

Answer:

"CoCoComputer Science"

Explanation:

First let's understand how the loop works, then we'll see what it does.

The variable i is initialized to value 0.  Then inside the loop, it's incremented by 2 in each loop passage, while i < 8, so the loop will be processed with the following values of i: 0, 2, 4 and 6.  It will run a total of 4 times.

Let's examine the actions done during the FIRST loop:

(str equals "Computer Science", so indexOf('m') = 2, i = 0)

- if the index of 'm' within the string is < i  (index = 2, i = 0, FALSE)

does nothing

increases value of i by 2 (now i = 2)

Let's examine the actions done during the SECOND loop:

(str equals "Computer Science", so indexOf('m') = 2, i = 2)

- if the index of 'm' within the string is < i  (index = 2, i = 2,  FALSE)

does nothing

increases value of i by 2 (now i = 4)

Let's examine the actions done during the THIRD loop:

(str equals "Computer Science", so indexOf('m') = 2, i = 4)

- if the index of 'm' within the string is < i  ( index = 2,  i = 4, TRUE)

then str becomes "CoComputer Science"

increases value of i by 2 (now i = 6)

Let's examine the actions done during the FOURTH loop:

(str equals "CoComputer Science", so indexOf('m') = 4, i = 6)

- if the index of 'm' within the string is < i  (index = 4,  i = 6, TRUE)

then str becomes "CoCoComputer Science"

increases value of i by 2 (now i=8)

Loop ends because i = 8 (i < 8 becomes false)

You might be interested in
An executable file that was determined to be infected with a virus was terminated from the running processes list. However, afte
Mama L [17]

Mostly Trojan will has multiple version and I love u virus extra.

<u>Explanation:</u>

As first step workstation or desktop or laptop to scanned for virus and if any virus or malware found then it should be removed first. Operating system should be updated with latest patch, virus signature also be updated once again executed founded by virus infected.

Better to copy new exes and place in the same folder and try to execute again. If still the problem persists download antivirus software such as Norton, bit defender, Kaspersky etc. executable files affected by 15-20 viruses

8 0
3 years ago
How do you install an operating system?<br><br> Answer with full sentences
denis23 [38]

Answer:

On Windows. Insert the installation disk or flash drive. Restart your computer. Wait for the computer's first startup screen to appear. Press and hold Del or F2 to enter the BIOS page. Locate the "Boot Order" section. Select the location from which you want to start your computer.

Explanation:

6 0
3 years ago
Assuming a 1-KB page size, what are the page numbers and offsets for the following address references (provided as decimal numbe
bagirrra123 [75]

<u>Answer:</u>

(a) page = 3; offset = 13

(b) page = 41; offset = 111

(c) page = 210; offset = 161

(d) page = 634; offset = 784

(e) page = 1953; offset = 129

8 0
2 years ago
To define constructors and member functions outside of a class's original scope, the operator can be used.
Artyom0805 [142]

Answer: Scope resolution operator(::)

Explanation: A member function and the constructor can be called within the function easily but for the execution of the these components outside the class , a special operator is required to call the functions. The scope resolution operator(::) preceding with the name of class is thus used for defining of the function outside class.This operator maintains the cope of the function and constructor outside the class.

8 0
3 years ago
How does a computer resolve a domain name into an ip address?
Yanka [14]

Answer:

Using the DNS service.

Explanation:

The computer sends a UDP packet with the domain name in it to port 53 of the configured DNS server, and expects a reply with the IP address of that domain.

8 0
3 years ago
Other questions:
  • After several incidents in __________ the company’s computer systems were not ready to support new products, the CEO established
    12·1 answer
  • How would you describe enterprise computing
    12·1 answer
  • Which of the following are examples of software? Check all of the boxes that apply.
    12·2 answers
  • python If the checksum is 10, the last digit is denoted as X according to the ISBN-10 convention. Write a program that prompts t
    10·1 answer
  • 1. In the.js file, write the JavaScript code for this application. Within the click event handlers for the elements in the sideb
    14·1 answer
  • What is this line of code doing? scanf("%f", &amp;height);
    6·1 answer
  • HELP ASAP!!!
    7·1 answer
  • When using correct ergonomic technique be sure to _____.
    11·2 answers
  • How was the Big Ben project similar to the investigation you conducted in class to determine if the table was vibrating? How is
    7·1 answer
  • Barbara, an employee, has properly connected her personal wireless router to a network jack inside her office. The router is una
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!