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
lubasha [3.4K]
4 years ago
14

Create a string called alphabet containing 'abcdefghijklmnopqrstuvwxyz', then perform the following separate slice operations to

obtain: The first half of the string using starting and ending indices. The first half of the string using only the ending index. The second half of the string using starting and ending indices. The second half of the string using only the starting index. Every second letter in the string starting with 'a'. The entire string in reverse. Every third letter of the string in reverse starting with 'z'.
Computers and Technology
1 answer:
spin [16.1K]4 years ago
7 0

Answer:

There is no short answer.

Explanation:

First let's create the string:

  • alphabetString = "abcdefghijklmnopqrstuvwxyz";

The first half of the string using slice method can be written as:

  • alphabetString.slice(0, 13);

The first half of the string using only the ending index can be written as:

  • alphabetString.slice(-13);

When we put - at the start of the index number, the counting begins at the last element with -1 and goes backwards.

The second half of the string can be written as:

  • alphabetString.slice(13,26);

The second half of the string using only the starting index can be written as:

  • alphabetString.slice(13);

To get the every second letter in the string, we need a for loop:

  • for( let x = 0; x < alphabetString.length(); x = x + 2){

                 alphabetString.slice(x);

}

To get the entire string in reverse, we can use the reverse method that is built-in:

  • alphabetString.reverse();

To get the every third letter of the string, we can again use a for loop:

  • for( let x = -1; x = -27; x = x - 3){

                  alphabetString.slice(x);

}

I hope this answer helps.

You might be interested in
I'm taking computer science and we are using a software called Python, i never used it before and the assignment is hard for me
Anarel [89]
Python has a help page on google I would definitely recommend that. Here is a link to the beginners guide https://wiki.python.org/moin/BeginnersGuide
3 0
3 years ago
After compiling source code, which command still needs to be run in order to copy the newly compiled binaries into a directory l
kumpel [21]

Answer:

Make install

Explanation:

In Computer programming, after compiling source code, make install still needs to be run in order to copy the newly compiled binaries into a directory listed in the PATH variable as well as copy supporting files (such as man pages) to the correct location on the filesystem.

In general, the commands that are executed by make install are defined in the Makefile.

5 0
4 years ago
When searching for your word processing file to finish writing your report, you should look for a file with which extension? (6
trasher [3.6K]

Answer:

doc

Explanation:

6 0
3 years ago
Which of the following is not a method of the history object?
Volgvan

Answer:

replace()

Explanation:

The history object in javascript corresponds to browsing history.

It has the following methods for navigating through the history list:

back(): Go back in the history list

forward(): Go forward in the history list

go() : Navigate to the currently pointed url in the history list. It takes a parameter which can either be a numeric index or a string which is matched with the history list content.

replace() is not a method in the history object.

7 0
3 years ago
What is the correct order for writing the 3 dimensions for a 3D object? Here are the 3 dimensions:
Nady [450]

Answer:

Length x Width x Hight

Explanation:

3 0
3 years ago
Other questions:
  • Element will you include to present numerical data on the slide
    13·1 answer
  • Someone please help me with the right answer please
    13·1 answer
  • Why do generated backup scripts usually include backticks around names such as database names and column names?
    5·1 answer
  • FINISH THE SENTENCE <br><br> buzzfeed____reddit_____
    5·1 answer
  • Analog false color in computer graphics
    6·1 answer
  • What is the meaning of website cookies? brief explanation ​
    9·2 answers
  • 1. Give one reason why data is represented in binary in a computer
    15·1 answer
  • Angelina has added page numbers to her report, but all of the pages are labeled "Page 1" at the bottom. What caused
    8·2 answers
  • Select which is true for for loop​
    11·1 answer
  • 20 POINTSS!! NEED HELP!!
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!