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
How would improving the nutritional health of an entire community impact the overall physical, emotional, and financial health o
allsm [11]

Answer:

The people of the thriving community has a more encouraging life than becoming a town or community of laziness and the fact that people will not help each other. When a community of people know one another they know the at that moment that everyone can get along, but when health comes as a problem, people's attitude toward each other change rapidly in a bad way, then the neighboring families become rivals, and people will not help others when it is most needed, and at that point, life in that area is a internal civil war.

4 0
3 years ago
Students recently created a Gaming Club at their school. On Friday of every week, students bring in their gaming consoles (Xbox,
ozzi

Answer:

first line, that is "The bandwidth of the school’s internet connection is lower than at home" is the correct answer.

Explanation:

The network school bandwidth, speed, and list of phones can all be considerations here. In school might have a network that does not allow high MBPS or via its ISP, it might have a low bandwidth plan. It based on the router's size, frequency, and link of the firewall and gaming network, the bandwidth may be lower.

  • The Most probably, the device isn't the source but it acts in the match were caused by the link.
  • If the school requires the server for transport broadband connections, the network can slow the process through pc specifications and link to either the network.

8 0
3 years ago
Which of the following correctly orders the units of measure from least to greatest?
gulaghasi [49]

Answer:

A.) Cup, Pint, Quart, Gallon

Explanation:

6 0
3 years ago
Read 2 more answers
Random access memory is the portion of a computer's primary storage that does not lose its contents when one switches off the po
brilliants [131]

Answer:

False

Explanation:

The RAM does lose its memory when you turn off the computer, unlike hard drive which is slower but keeps memory

4 0
3 years ago
Read 2 more answers
What keyword is used to declare a method in python?
Harrizon [31]
I think the answer is B
8 0
3 years ago
Other questions:
  • ____, developed by xuejia lai and james massey, is a block cipher that operates on 64-bit blocks of plaintext.
    10·1 answer
  • Chloe is building a kiosk-based Excel application. She wants to make some modifications to the screen elements in order to keep
    8·1 answer
  • Janelle is shopping for jeans from Express. She clicks on a style she likes. The site quickly presents her with a close-up view
    5·1 answer
  • Spreadsheet software creates a ____, composed of a grid of columns and rows
    6·1 answer
  • What is the order in which windows systems receiving and process multiple gpos?
    7·1 answer
  • Convert to octal. Convert to hexadecimal. Then convert both of your answers todecimal, and verify that they are the same.(a) 111
    12·1 answer
  • Which type of fiber-optic connector, containing one fiber-optic strand per connector, is connected by pushing the connector into
    7·1 answer
  • Your source data is of 50 GB. You make a full backup. Next week, once again you perform a full backup, but this time 10 more GB
    10·1 answer
  • Technical term of stealing personal information in social media.​
    5·1 answer
  • please help me to do this computer homework I beg you all please help me to get the answers please its important please ​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!