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
Ilia_Sergeevich [38]
3 years ago
11

java Write a program that reads a list of words. Then, the program outputs those words and their frequencies. The input begins w

ith an integer indicating the number of words that follow. Assume that the list will always contain less than 20 words.
Computers and Technology
1 answer:
vfiekz [6]3 years ago
6 0

Answer:

The following are the program in the Java Programming Language.

//set a package

import java.util.Scanner;

//define class

public class Main  

{

 //define a main method

 public static void main(String[] args)  

 {

   //declare the Scanner class object

   Scanner s = new Scanner(System.in);

   //get the size of the array from the user

   int size=s.nextInt();

   //declare an integer array with given size

   int a[]=new int[size];

   //declare a string array with given size

   String word[]=new String[size];

   //set the for loop  

   for(int i=0;i<size;i++)

   //get string input from the user

   word[i]=s.next();

   //iterates with the array, increase the count

   for(int i=0;i<size;i++)  

   {

     for(int j=0;j<size;j++)  

     {

       //check that elements of words

       if(word[i].equals(word[j]))

         //increament in the array by 1

         a[i]++;

     }

   }

   System.out.print("\n");

   //set for loop to print the following result

   for(int i=0;i<size;i++)

     System.out.println(word[i]+" "+a[i]);

  }

}

Explanation:

<u>The following are the description of the program</u>.

  • Firstly, set the required predefined package and define class 'main then, define main method inside the class and inside the method.
  • Declare the object of the scanner class and get the size of the array through the object in the variable 'size'.
  • Then, declare two array which are integer type 'a' with the given input size and string type 'word' with the given input size.
  • Set the for loop that get string type array elements from the user and again set two for loop that increase the size of the integer data type array by 1 with the loop iteration.
  • Finally, set the for loop that print the following result.
You might be interested in
You are trying to appreciate how important the principle of locality is in justifying the use of a cache memory, so you experime
murzikaleks [220]

Answer:

Explanation:

Attached is the solution

3 0
3 years ago
How many megapixels is in a macbook air 2017 camera
Anastasy [175]

Answer:

.7

Explanation:

3 0
3 years ago
What is meaning of reboot
TEA [102]
I believe to reboot is to reset. Its the act of resetting, or starting up a computer again.
4 0
3 years ago
Read 2 more answers
WordArt styles allow you to add ____.
maria [59]
As for this problem, the most probable and the most likely answer to this would be it depends on the person or the user of it since there aren't any options presented with the problem.

WordArt is there to be of use during presentations, during discussions, and other things. On the other hand, as the technological advancement takes leaps and bounds going forward, this utility seems to be underused and isn't expected to give a more impact to the reader or to the recipient of such document that contains it. This is typically used for people that aren't too familiar yet, as to how to utilize other programs to enhance their documents and files.
3 0
3 years ago
If a 60 lb. load is placed on the platform, what will the pressure gauge reading be if the piston area is 5 sq.in? Give your ans
Doss [256]

Answer:

The pressure gauge reading will be;

12 psi

Explanation:

The question relates to relationship of pressure and area

The given parameters for the measurement are;

The weight of the load = 60 lb

The required area of the piston = 5 in.²

Pressure exerted by a force can be defined as follows;

Pressure =  \dfrac{Force}{Area}

The weight of the load = The force applied by the load

Therefore;

Pressure =  \dfrac{Force}{Area} = \dfrac{60 \ lb}{5 \ in.^2}  = 12\dfrac{lb}{in.^2} = 12 \ psi

The gauge reading will be 12 psi.

7 0
3 years ago
Read 2 more answers
Other questions:
  • Which is a characteristic of an effective problem statement? It is based on research. It contains outside information. It contai
    12·1 answer
  • A key field is used to _____. enter a password uniquely identify records merge data list the most important information
    12·2 answers
  • An algorithm written out in plain English statements is called __________.
    8·1 answer
  • The computerization of the layout and paste-up process further complicated printing, as did the digitizing of photographs.
    12·1 answer
  • How to solve a program that accepts a number as input and prints just the decimal portion
    15·2 answers
  • Design a class named Person and its two subclasses named Student and Employee. Make Faculty and Staff subclasses of Employee. A
    13·1 answer
  • In PowerPoint online what can you add to your presentation from the insert tab
    8·2 answers
  • Debug the recursive reverseString method, which is intended to return the input String str reversed (i.e. the same characters bu
    13·1 answer
  • ________ is the use of information technology to support the sharing of content among networks of users.
    14·1 answer
  • The startup routine runs,when machine boots up is known as​
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!