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]
2 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]2 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
________ is the art of manipulating people into breaking normal security procedures or divulging confidential information.
Alina [70]

Answer:

Social engineering is a process of manipulating people into breaking normal security procedures or divulging confidential information.

Explanation:

7 0
2 years ago
Reading a news release about a product is an example of <br> research.
Oduvanchick [21]

Answer:

Yes, it is true, because it informs you

Explanation:

5 0
3 years ago
Answer all of the questions,
Phantasy [73]

Answer:

sry but I don't know the answer

5 0
2 years ago
You have a server called server1 that is running windows server 2012. what command would you use to delete the ptr record for 10
dybincka [34]
You could use th dnscmd server1 /recorddelete command that would allow you to delete record through powershell
3 0
3 years ago
Describe the role of the microprocessor in an automatic washing<br> machine (IGCSE)
Ann [662]
The microprocessor is programmed to follow the logic sequence of operation.

Monitoring various operator inputs, digital and analog inputs. Outputs to controlled devices take place.

Inputs: start switch, door safety contacts, water level sensor, wash cycle selector switch, etc.

Outputs: drive motor, motor speed regulation , reversing solenoids etc
3 0
3 years ago
Other questions:
  • <img src="https://tex.z-dn.net/?f=3x%20-%205%20%3D%203x%20-%207" id="TexFormula1" title="3x - 5 = 3x - 7" alt="3x - 5 = 3x - 7"
    12·1 answer
  • You've been asked to find the largest number in a range of numbers. Which of the following could you use to find the largest num
    8·1 answer
  • Bayley wants to connect a new external hard drive to his Windows PC. He wants the fastest connection type available because he p
    9·2 answers
  • Number Array Class
    5·1 answer
  • The engineering firm you work for is submitting a proposal to create an amphitheater at a state park. Proposals must be submitte
    15·1 answer
  • Suppose that we are using PDDL to describe facts and actions in a certain world called JUNGLE. In the JUNGLE world there are 4 p
    7·1 answer
  • 6. Python indexes lists beginning with the number 1.<br> True<br><br> False
    15·1 answer
  • How do you fix this!!!!
    5·1 answer
  • To use the replace feature we can simply just press Carl+h,Carl+c,Carl+r
    13·1 answer
  • If “A” represents in binary 10011001, what will be the value of word “CAB”?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!