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
Which pane is used to modify the actual content of the SmartArt graphics as opposed to the layout and design?
Zigmanuir [339]
Text i belive thats the answer
7 0
3 years ago
Elaboren un texto acerca de una caracteristica o<br>componente de algun sistema tecnologico.<br>​
LUCKY_DIMON [66]

Answer:

<em>Teniendo en cuenta el sistema hidráulico se puede mencionar la siguiente característica teniendo en cuenta el principio de Pascal:</em>

  • <u><em>La presión ejercida sobre un fluido en área pequeña es igual a las fuerza ejercida sobre un fluido en un área más grande.</em></u>

Explanation:

<em>El principio de Pascal menciona en términos generales que l</em><u><em>a fuerza ejercida sobre un fluido se ejerce sobre el total del fluido y en todas las direcciones</em></u><em>, sin embargo, basado en este concepto se encuentra el principio de la prensa hidráulica (que se menciona en la respuesta), el cual se podría expresar de la siguiente forma:</em>

  • <em>F1/A1 = F2/A2</em>

<em>Donde:</em>

  • <em>F </em><em>= Fuerza ejercida.</em>
  • <em>A</em><em> = Área en la cual se ejerce la fuerza.</em>

<em>Lo que se busca es ejercer una fuerza en un área pequeña que se vea reflejado como una gran fuerza en un área más grande. Éste principio se suele usar para el levantamiento de maquinaria como automóviles en los concesionarios.</em>

8 0
3 years ago
The "Father of the Computer" was _____________, an Englishman, who in 1836 produced designs for a "computer" that could conduct
Leviafan [203]

Answer:

Charles Babbage is the correct answer to the following question.

Explanation:

Charles Babbage is the person who invented the computer, but he failed to build the computer system and the first engine was finished in year 2002 in London, after 153 years of his death but he was an inventor and the father of the automatic computing engines.

So, that's why he was called as the "Father of Computer".

5 0
3 years ago
What is computer ????
LekaFEV [45]

Answer:

Explanation:

A computer is a device that manipulates information, or data accrding to the instructions given to it and give us an output. It has the ability to store, retrieve, and process data.

6 0
4 years ago
Sharon reads two different articles about avocados. The first article, in a weight loss magazine, claims that avocados are unhea
padilas [110]
The first and third.
3 0
3 years ago
Read 2 more answers
Other questions:
  • The number of protons plus the number of nuetrons equal the <br> A.atomic weight<br> B.atomic number
    10·1 answer
  • I have to write a program with a function that finds the biggest out of 3 numbers, but the problem is i have to use a reference
    6·1 answer
  • Which of the following is a step in paraphrasing?
    14·2 answers
  • In modern web design, color, font, font size, and style should be declared using:
    5·1 answer
  • All systems have ___________.
    9·2 answers
  • Create a do-while loop that asks the user to enter two numbers. The numbers should be added and the sum displayed. The loop shou
    5·1 answer
  • Which sentence describes a biotechnology method of treating sulfur liquor in the paper industry?
    11·1 answer
  • StreamPal is an audio-streaming application for mobile devices that allows users to listen to streaming music and connect with o
    6·1 answer
  • Which of the following is a type of input device?
    5·1 answer
  • Straight dinosaur walks out of woods : RAWWRRRR
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!