answer.
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
Iteru [2.4K]
2 years ago
15

Write a static method, getBigWords, that gets a single String parameter and returns an array whose elements are the words in the

parameter that contain more than 5 letters. (A word is defined as a contiguous sequence of letters.) EXAMPLE: So, if the String argument passed to the method was "There are 87,000,000 people in Canada", getBigWords would return an array of two elements, "people" and "Canada". ANOTHER EXAMPLE:__deletedc942e16469dfc985bad93686bef33709ea1d39aa11de399983e1c15bed9d613adeleted__", getBigWords would return an array of three elements, "request", "support" and "turingscraft".
Computers and Technology
1 answer:
ZanzabumX [31]2 years ago
7 0

Answer:

import java.util.*;

public class Solution {

   public static void main(String args[]) {

       Scanner scan = new Scanner(System.in);

       System.out.println("Enter the words.");

       String userInput = scan.nextLine();

       

       String[] splitedString = userInput.split(" ");

       getBigWords(splitedString);

       

   }

   

   public static void getBigWords(String[] listOfWord){

       ArrayList<String> list = new ArrayList<String>();

       

       for(int i = 0; i < listOfWord.length; i++){

           if(listOfWord[i].length() > 5){

               list.add(listOfWord[i]);

           }

       }

       

       for (String temp : list) {

  System.out.println(temp);

 }

   }

}

Explanation:

The first line is the import statement which import the classes needed for this class: Scanner and ArrayList.

The class was defined as Solution. Then, the main method is defined. Inside the main method a scanner object is created called scan to receive user input.

The user is prompted for input, which is stored as userInput. The userInput is then splitted and stored in an array called splitedString.

The method that perform the string manipulation is called getBigWords, the method take the splittedString as a parameter.

Next, the getBigWords method is defined; it takes an array as parameter. The parameter is called listOfWord. Inside the getBigWords method, an ArrayList called list is initialized. The list is to hold string whose length is more than 5.

The first for-loop loop through the listOfWord and check if any element has length greater than 5. If there is, the element is added to the list arraylist.

The second for-loop loop through the list to output the words whose length is greater than 5.

You might be interested in
You learn that in a previous security breach at GearUp, a disgruntled employee destroyed the encryption key that had been used t
lukranit [14]

Answer:

The data can be safeguarded using key escrow procedure.

Explanation:

Key escrow basically means to store the cryptographic key in an "escrow" by a reputable trusted third party. The copy of the encryption key is kept with the third party. In case the cryptographic key gets lost or destroyed, then the key escrow service helps to access the encrypted data. It also manages the access control to the key in case the key gets lost. So this way in case of security breach at GearOn the key escrow service can be used to re-implement or access the key easily.

6 0
2 years ago
Simon wants to use an invoice template created by Office.com. The first step after selecting the File tab is to select
wlad13 [49]
The type of file which can be PNG, Jpg, etc.
4 0
2 years ago
6. A small design agency you are consulting for will be creating client websites and wants to purchase a web server so they can
Novay_Z [31]

Answer:

Explanation:

The best way to advise the agency in this matter would be to help them completely understand the total cost of ownership of the server. This includes the server itself but many other factors as well. Such as any and all server software and application software that they will need, an IT server manager, facility costs, security costs, backup features. These are some of the main costs that they will be incurring but there may be more unforeseen costs. Therefore the best way to advise them is by providing all of this information so that they can make the most informed decision possible.

3 0
2 years ago
How do i use autofill to fill the range A9:H11 with the formatting from the range A7:H8
myrzilka [38]

Answer:

See the explanation below

Explanation:

An image showing the range of cells is attached.

The task is to use autofill to fill the range of A9:H11 with the formatting from the range of A7:H8;

As shown in the image some cells are already filled. First, we highlight the cells A7:H8 and then we move the cursor to the end of the selected cell (precisely end of H8) over what is called Fill Handle and the cursor then turns into a black plus sign.

Hold down the right mouse button and drag over the wanted range of cells (A9:H11) and release.

A list of options is presented, this options include:

Copy cells, Fill series, Fill formatting only, Fill without formatting and so on.

From the displayed options, we select "Fill formatting only" and the cell (A9:H11) will have the same formatting as the cells (A7:H8).

3 0
2 years ago
What is the difference between paper size and page margins in Word?
sergij07 [2.7K]

Answer:

Paper size refers to the size of the paper you will be printing your document on, while page margins refer to the outside area of a page that can be made bigger or smaller to fit content.

Launch the Page Setup dialog box from the Page Setup group; in the Margins section, enter the page margin values and click OK.

All the statements are correct.

Right-click and add to dictionary

Type the words onto the first page of the document, and click on the Header button to repeat it on all of the other pages

pictures shapes and clipart

none of the above

Explanation:

7 0
2 years ago
Other questions:
  • What does the following function return? void index_of_smallest(const double all, int startindex, int numberOfSlots); A. a doubl
    7·1 answer
  • Identify the normalized form of the mantissa in 111.01.
    14·1 answer
  • Why can't you use Friedman's attack on block ciphers?
    12·1 answer
  • Your reputation and credibility will be immediately destroyed if your website contains?
    8·2 answers
  • Instructions:
    14·1 answer
  • Based on virtualization technologies, how many types can we classify them? Please give a brief statement on each of them?
    14·1 answer
  • Define a function ComputeGasVolume that returns the volume of a gas given parameters pressure, temperature, and moles. Use the g
    13·1 answer
  • The Coins class was created to hold all your loose change, kind of like a piggy bank! For this exercise, you are going to simula
    15·1 answer
  • You need to replace a broken monitor on a desktop system. You decide to replace it with a spare monitor that wasn't being used.
    15·2 answers
  • What should businesses do in order to remain competitive under the current Cloud<br> landscape?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!