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]
3 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]3 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
Sandie is writing a report for her environmental science class. She has asked her older sister who is away at college to proof h
vichka [17]
Help each other because if the other sister is older she should have more experience and knowledge

8 0
3 years ago
Read 2 more answers
What are the common operations performed on character strings?
monitta
<h3>Answer(:</h3>

•concatenation

• scanning

• substringing

• translation

• verification

<h3>if you want to remember means csstv;-)</h3>
7 0
2 years ago
Which of the following are logical reasons for using a pie chart to show how employees spend their time at ABC organization? Cho
MissTica

Answer:

1,2, and 4 I believe

Explanation:

I hope that helped :D

5 0
3 years ago
What is it called when u want 2 or more cells into 1
den301095 [7]

Answer:

Concatenate

Explanation:

mark me brainliest!!

5 0
3 years ago
Read 2 more answers
Write a 5 sentence paragraph about why charles babbage invented the computer.
Colt1911 [192]

Answer:

The computer was invented in order to automate mathematical calculations that were previously completed by people. Charles Babbage is considered to be the “father” of the computer.

Explanation:

4 0
2 years ago
Read 2 more answers
Other questions:
  • What is a valence orbit?
    13·2 answers
  • Which method of deleting files can be used in windows xp and vista?
    12·1 answer
  • Which of the following journals is not aimed at the public as well as scientists?
    7·1 answer
  • How do I do a PowerPoint
    10·2 answers
  • Which of these image sizes takes the most storage space?
    8·2 answers
  • The ash and dust from a volcanic eruption can cause a ______ change in the environment.
    8·1 answer
  • Bob has 2 candy bars he is fat what hapennes
    5·2 answers
  • HELP PLX ITS PYTHON BTW!!!
    8·1 answer
  • The price of an item you want to buy is given in dollars and cents. You pay for it in cash by giving the clerk d dollars and c c
    6·1 answer
  • Group of programs are software ​
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!