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
How can I hide my cracked phone screen? or How can I fix it myself without my parent finding out? or How can I fix my phone with
sammy [17]
Ummm I don’t know how to answer that
8 0
3 years ago
Sites like Zillow get input about house prices from a database and provide nice summaries for readers. Write a program where the
SCORPION-xisa [38]

a aj ji hfjizbhig jiad jv hD jug vhi SDhvb hbnsdubghi

a biabihb hsjgbidbihdgbhibsrhkgbhibshibvghibsdgjo

asbihdg hibsihbghibdshibghbshbg9bhisdbghivbhbhir

aa sbuogjanjfjnbsujoenngobuewwwwwwwwwwwwwwwwwwwwwwww0o

8 0
2 years ago
Where are the Add Level and Delete Level buttons located? Filter options list Sort &amp; Filter group Sort dialog box Custom fil
BaLLatris [955]

Answer:

Sort dialog box

Explanation:

Sort dialogue box is used to sort data in Excel.

The add level Adds another row to the dialog box so additional columns can be sorted while the delete level removes any unwanted level. How to access it: Press the down arrow beside the sort order tab. Tap the button "The Largest to Smallest". Tap the Add level button.

6 0
2 years ago
What does the term World Wide Web refer to?
Katena32 [7]
The internet because its world wide because our computers and everything are all inter twined making a world wide web Hope this helps
3 0
3 years ago
Read 2 more answers
An Oven Is Just A Spicy Refrigerator? Yes Or No??
Marianna [84]

Answer:

No

Explanation:They both have different actions

3 0
2 years ago
Read 2 more answers
Other questions:
  • Which presentation software element can you use to create a model diagram with two concentric circles inside a triangle?
    10·2 answers
  • How do you think your ability to work might be affected if you don’t magnify a document so that text is at a size for you to rea
    9·1 answer
  • Explain the relationship between society and the technologies of using Earth's resources?
    14·1 answer
  • Michale spent 80 minutes at the libary he finished studying at 4:00 what time did michale start studying
    8·1 answer
  • keeping in mind the role in order of precedence plays in equations, what would excel display as the result of the following equa
    14·1 answer
  • Choose the HTML5 element below that is used to configure an area on a web page that can stand on its own and could potentially b
    5·1 answer
  • Write code which takes inputs and creates two Rectangle objects (using the edhesive.shapes.Rectangle class) and compares them us
    7·1 answer
  • PLEASE HURRY!!!!
    8·2 answers
  • Write an alogrithm to display the first ten even numbers​
    6·1 answer
  • Risk taker positive or negative​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!