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
Iteru [2.4K]
3 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]3 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
Does the security burden fall primarily on the user? On
liubo4ka [24]

Answer:

yes and no because of the security

Explanation:

yes and no because of the security

6 0
3 years ago
Which evaluation factor will be most important when choosing technology for the company
soldier1979 [14.2K]

Answer and Explanation:

Look for a company's latest updates, see what servers they use, check if they're using the latest technology like containers or AI and look for how flexible they are with regards to change and innovation.

7 0
3 years ago
Describe personal computer skills using three adjectives?
Volgvan

Answer:

proficient with Microsoft word Excel and PowerPoint

Explanation:

compost and send over 150 images microsoftop creating and the formatting simple office budget speed sheets on Microsoft Excel Bros and its documents Microsoft word

5 0
2 years ago
Read 2 more answers
Which area of the network would a college it staff most likely have to redesign as a direct result of many students bringing the
Artist 52 [7]
The area of network that the students would be using is the wireless LAN. For the wireless LAN, enables students to connect to the internet with the use of their tablets and smart phones for it is the network that connect to a network that are wireless and are not needed to be connected with the use of wires or cables.
6 0
3 years ago
. In the BorderLayout class, what are NORTH, SOUTH, EAST, WEST, and CENTER?
ycow [4]

Answer:

A BorderLayout corresponds to a layout type where the components are organized along geographical directions represented by NORTH, SOUTH, EAST, WEST, and CENTER.

Explanation:

The layout class is awt determines the actual placement of components in the user interface. BorderLayout is a layout where the components are organized along geographical directions represented by NORTH, SOUTH, EAST, WEST, and CENTER. For example:

Panel p = new Panel();

p.setLayout(new BorderLayout());

p.add(new TextArea(), BorderLayout.CENTER);

p.add(new Button("Close"), BorderLayout.SOUTH);

This code segment will add a textarea at the CENTER of the interface and a button 'Close' towards the SOUTH.

8 0
3 years ago
Other questions:
  • Marco makes $65,000 a year as a graphic designer. He makes a charitable donation of $1,000 each year. He also has $5,000 of busi
    12·2 answers
  • You have implemented nap with dhcp enforcement, so you need to ensure you have an updated anti-virus software package, an update
    7·1 answer
  • Give two reasons to break up
    11·2 answers
  • The keyboard usually has six rows of keys. Which of the following is not one of the key group categories?
    7·2 answers
  • 2. Use the Internet to research Robocopy switches and then construct a command line that will use Robocopy to copy files in rest
    14·1 answer
  • What is the code for this please?​
    13·1 answer
  • The first cell phones in widespread use were . Smartphone technological advancements added services. Answer the following questi
    12·2 answers
  • Write a program to have the computer guess at a number between 1 and 20. This program has you, the user choose a number between
    9·1 answer
  • 4. When working at the CLI in Linux, you specify the exact location of a file, which is the ____________________ to it, by begin
    13·1 answer
  • You are investigating the use of website and URL content filtering to prevent users from visiting certain websites. Which benefi
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!