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
How do you represent (decimal) integer 50 in binary
il63 [147K]
Its 110010. i hope this helped
7 0
3 years ago
You bought a monochrome laser printer two years ago. The printer has gradually stopped feeding paper. Which printer component sh
lilavasa [31]

Answer:

Pick up roller

Explanation:

you should first check the pickup roller component. This component is the part of the printer that picks paper up from the paper tray. The pickup roller links the printer and the paper. When the printer printer is running, the roller would take paper from the paper tray for the printer to print on. One of the issues it can have is Paper jam where the roller would stop turning so that it will no longer be picking papers up from the tray.

3 0
3 years ago
Edra wants to consolidate the data from each of the regions. Switch to the Consolidated Sales worksheet, then update the workshe
VashaNatasha [74]

Answer:

a. In cell A6, enter a formula without using a function that references cell A6 in the Washington worksheet.

b. Copy the formula from cell A6 to the range A7:A9 without copying the formatting.

Explanation:

Microsoft Excel is a spreadsheet application used for data analysis and statistical calculation. The worksheet is made of columns and rows like a table and labeled alphabetically and numerically respectively. Several worksheets can be referenced in an excel workbook

To consolidate data in excel, reference a cell from another worksheet in the formula of the current worksheet and copy the formula from the cell to a given range of cells, without copying the formatting of the cell.

7 0
3 years ago
If you want to create programs with more detailed images, maybe even characters that you could interact with, what pieces of inf
Oliga [24]

The pieces of information needed in the code to create a more detailed program are the sprite objects

<h3>What are sprites?</h3>

Sprites are program objects that are used in a program to add more features such as detailed images, characters and animations in the program.

The sprite objects are dragged and dropped on the program

Hence, the pieces of information needed are the sprite objects

Read more about object-oriented program at:

brainly.com/question/25649719

6 0
2 years ago
JAVA
ella [17]

Answer:

Explanation:

The following code is written in Java. It creates a function that takes in an ArrayList and an int parameter. Then it loops through the array and adds each element into a new array called newList but adds them the number of times that the numRepeats argument states. Output can be seen in the attached image below.

import java.util.ArrayList;

class Brainly{

   public static void main(String[] args) {

       ArrayList list = new ArrayList();

       list.add('a');

       list.add('b');

       list.add('c');

       ArrayList newList = repeatArrayList(list, 3);

       System.out.println(newList);

   }

   public static ArrayList repeatArrayList(ArrayList list, int numRepeats) {

       ArrayList newList = new ArrayList();

       for (int x = 0; x < numRepeats; x++) {

           for (int i = 0; i < list.size(); i++) {

               newList.add(list.get(i));

           }

       }

       return newList;

   }

}

5 0
3 years ago
Other questions:
  • Which are examples of copyrighted online materials? Check all that apply.
    14·2 answers
  • Where does gateway antivirus scan for viruses
    7·1 answer
  • What is the purpose of filters in a database?
    11·1 answer
  • A(n) _____ is someone who uncovers computer weaknesses and reveals them to manufacturers or system owners, without exploiting th
    15·1 answer
  • Backordered Parts is a defense contractor that builds communications parts for the military. The employees use mostly Web-based
    10·1 answer
  • What would be the best thing you could do to prepare yourself to work for a company that has embraced globalization. A) learn ho
    12·2 answers
  • Scanning low allows you to locate __________ before you hit them
    13·1 answer
  • Write function that ask for input from a user. Use this input as input for the countdown function that we wrote using the while
    6·1 answer
  • Explain the following terms <br><br>copyleft:<br><br>creative Commons:<br><br>GNU/GPL:​
    8·1 answer
  • When is the POST process executed?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!