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
Use the function varimp() on the output of train() and save it to an object called imp:_____.
Orlov [11]

Use the function varimp() on the output of train() and save it to an object called imp object.

<h3>What is the classification that has More than Two Classes and the Caret Package</h3>

In the Classification that has More than Two Classes and the Caret Package section, one need to use the methods that can be able to adapt to higher  forms or dimensions and through a lot of different machine learning algorithms.

Note that varImp is seen as a generic method for calculating variable .

Hence, Use the function varimp() on the output of train() and save it to an object called imp object.

Learn more about Computer function from

brainly.com/question/17048576

#SPJ1

5 0
1 year ago
Which layer enables the receving node to send an acknowledgement?
Svetllana [295]

Answer:

Data link layer enables the receiving node to send an acknowledgement.

Explanation:

The data link has following function;

1 it send the acknowledgement to the node because for the reliable    transmission.

2.Data link layer provides the interface to the network layer.

3.it regulate  the flow of data.

4.It control the transmission error.

The important function of data link layer it created packets of the data to send the packets in guarantee manner for giving the acknowledgement to the node that data is received successfully.

6 0
3 years ago
Write a program that asks the user for the name of a text file. the program should display the last 10 lines of the file on the
Tom [10]
The only thing that I know is that after you input the text file, it could either:
-save those lines as a variable
-display the text file
However any more would be dependent on the language.
3 0
3 years ago
In minecraft Education Edition what is the crafting recipe for Balloons and Glow sticks?
schepotkina [342]

Answer

sorry I only know how to make balloons :(

Explanation:

For the balloons the recipe that one is:

- you will need 6 latex

To make latex you will need two different elements one is 5 Carbon and the other one is 8 Hydrogen ( don't use crafting table to do it use the compound creator)

-Dye ( whatever color you want)

-Helium

-lead

Instructions

on the crafting table the latex will go on the sides (3 on the left and 3 on the right). The dye goes on top, the Helium in the middle and the lead at the bottom and there you go a balloon

8 0
3 years ago
Read 2 more answers
With working from home now becoming a norm what is an effective network for an organization to secure its internal resources acc
Umnica [9.8K]

Answer:

Always encrypt data never store anything in plain text someone could use wireshark to pull out a data packet and if the data is not encrypted, expect things to happen.

4 0
2 years ago
Other questions:
  • Ned and mary ann are saving their files to a cd
    15·1 answer
  • What is an optical storage device?
    7·2 answers
  • You asked your colleague to provide feedback on a blog post you recently wrote. When they sent you their feedback, they made edi
    10·1 answer
  • Black Ops 3 For Ps4 Players Here
    7·1 answer
  • Find the mistakes in the following code. Not all lines contain mistakes. Each line depends on the lines preceding it. Watch out
    14·1 answer
  • During detachment, _____.
    12·2 answers
  • Identify what a computer needs to
    14·1 answer
  • Which option should Gina click to edit the text contained in a text box on a slide in her presentation?
    13·2 answers
  • Aranjează următoarele cuvinte din documentul word Proiect, într-o scrisoare în care soliciți directorului școlii sprijin în priv
    8·1 answer
  • Which background-repeat value represents this div?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!