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
In today's society, unethical actions are: A) Easier than ever to get away with, because the general public and insurers are les
ra1l [238]
B I think is the best answer
7 0
3 years ago
Read 2 more answers
Help please not trying to fail
deff fn [24]

Answer:

B. Everywhere CFCI is not

8 0
3 years ago
Bunco is a dice throwing game that requires no decisions to be made or skill on the part of the player just luck. In the simples
anygoal [31]
Abcdefghijklmnopqrstuvwxyz now I know my abcs, next time won’t you sing with me :)
8 0
2 years ago
Select all the correct answers.
krok68 [10]

Answer:

Higher resolutions in games

Smoother, faster playback

Explanation:

A graphics card is a piece of hardware installed on a computer that that is responsible for rendering the image on the computer's monitor or display screen. Graphics cards come in many varieties with varying features. The CPU will send any graphics related tasks directly to the GPU while it continues to process other tasks. Because graphics cards use a lot of power they need a cooling fan. The cooling fans are noisy so they make the computer sound louder than they were before the graphics card was installed.

7 0
2 years ago
Read 2 more answers
Identifying what you will need to review takes place during?
marishachu [46]
It takes places during surveying.

For example, let's say you want to review your own produced game application software, and found out whether it satisfy your consumer or not

Before you conduct the survey, you have to identify what aspect you want to find out from your consumers , such as : Does it have any bug ? Is it challenging enough ? is the graphic good enough ? etc
7 0
3 years ago
Read 2 more answers
Other questions:
  • A school librarian has been asked to identify inappropriate Internet usage. Which students would most likely be reported to the
    5·2 answers
  • trhy356<br>yjetyi46ui y j4yhnpug 2utg[ 2[ 24[ou [o24t
    15·1 answer
  • The main characteristic of ____ is that its source code is published with the software.
    7·1 answer
  • Minimalism is a major movement in postmodern art. O True O False
    14·1 answer
  • What is the windows server 2012 r2 feature that enables you to maintain previous versions of files on a server, so that if users
    10·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    11·1 answer
  • What type of data can we enter in a spreadsheet?
    11·1 answer
  • What is ana absolute adress
    11·1 answer
  • Susan works for a company that values their employees me and deadlines in finding ways to keep the cost of doing business low wh
    12·1 answer
  • Search..
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!