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
X2/3-2x1/3-35=0
Ganezh [65]

Answer:

x2/3-2x1/3-35=0

Two solutions were found :

x =(2-√424)/2=1-√ 106 = -9.296

x =(2+√424)/2=1+√ 106 = 11.2

Explanation:

7 0
3 years ago
Why students might want headsets for their computers?
VARVARA [1.3K]
It can be noisy and distracting to students to listen to audio speakers when there are multiple computers in the classroom. Headphones help the students
3 0
3 years ago
Differentiate between tabular and column form layout​
NeTakaya

In tabular form the data is displayed in a table layout following a continuous series of records. In this almost all the records are displayed in a single layout. While in columnar form the data is displayed one record at a time.

6 0
2 years ago
HELP PLEASE I WILL GIVE YOU 15 POINTS!
scoundrel [369]

Answer:

look up some stories if you can like about dogs or something and then write why you like animals then write about how much you need to know about dogs or cats to be a good dog/cat owner

Explanation:

I already gave you the two stories didn't I in your last questions?

4 0
3 years ago
A short cut to save a file is
Vanyuwa [196]

Answer:

CTRL+S in most programs

8 0
3 years ago
Other questions:
  • For a loop counter, the appropriate data type would be:
    14·1 answer
  • A beginning driver may tend to oversteer. This means the driver what? Btw Cars are technology so that is why it is under Compute
    11·1 answer
  • Fill in the blank: _________ is Google’s machine-learning artificial intelligence system that interprets people’s searches to fi
    9·1 answer
  • What does a coder do on a daily basis?
    8·1 answer
  • What is the missing line of code?
    10·2 answers
  • Can you explain the difference between software and hardware? Tell me 3 examples of each one.
    10·1 answer
  • Compare and contrast the advantages and disadvantages of a LAN to a WLAN.
    8·1 answer
  • Mario kart is mercedes lol
    13·2 answers
  • Uh can somebody help me
    6·1 answer
  • What are some of the most common obstacles in video games?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!