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
Jenny's needs to buy a computer to create word documents, make presentations, listen to music, and watch movies and videos. Whic
AveGali [126]
Years ago that would be C only, but nowadays Linux also comes with applications that can create word documents, make presentations and all that.
8 0
4 years ago
Calculate the cash used to retire debt for each of the six months. Since the company can't pay down more debt than there is cash
BabaBlast [244]

Answer:

The required cash used to retire a debt can be computed as follows:

Cash used to retire debt = cash available to retire a debt, if the cash available to retire debt is less than the loan balance from previous month. Otherwise, cash used to retire debt is equal to the loan balance from previous month.

The excel formula to perform this task is provided as follows:

D33 = IF(D32<C34,D32,C34)

The same formula is used to get the values for E33 to I33.

Explanation:

See the attached picture for table.

5 0
3 years ago
Your company has just opened an office in another state and you need the computers to communicate between the offices. What type
galina1969 [7]

Answer:

WAN network

Explanation:

A WAN network is an abbreviation for wide area network. This telecommunication network is mainly used for networking computers. They are not tied to just one location. They can also be called network of networks. It connects several LANs. The lans stand for local area and networks and they are computer networks and devices that are connected to each other within a geographical area.

8 0
3 years ago
Answer im timed i'll mark brainliest
NNADVOKAT [17]

Answer:

The answer is shapes.

Explanation:

5 0
3 years ago
On a web page coded in HTML, there is a sentence that reads, "Welcome to Assessments Section." Sam wants to insert the word "the
Natalka [10]

Answer:

The inserted text will appear as underlined text. The deleted text will appear as strike through text.

Explanation:

In HTML the text which has been inserted will appear as underlined text. It means if we insert something in HTML then it will underline it. This will highlight the text that has been inserted. While on the other hand if we delete some text and replace it with some other text, then it will appear as strikethrough text.

Strikethrough text is the text which is represented with a horizontal line in its center. It represents those words which are added by mistake and are not meant for inclusion.

7 0
4 years ago
Other questions:
  • The operating system, and in particular the scheduler, is not an important component of a real-time system.
    14·1 answer
  • Print a message telling a user to press the letterToQuit key numPresses times to quit. End with newline. Ex: If letterToQuit = '
    12·1 answer
  • Jed is the database administrator for a mid-sized computer component manufacturer. He is responsible for validating the data mod
    12·1 answer
  • How is a geometric constraint different from a numeric constraint?
    12·1 answer
  • Suppose that a disk drive has 2,000 cylinders numbered 0 to 1999. The drive is currently serving a request at cylinder 142, and
    8·1 answer
  • Tests that replace_punctuation() replaces 1 exclamation point and 2 semicolons in "we'll continue our quest in space. there will
    14·1 answer
  • A part-time job performed while in high school must have the approval of your school counselor.
    7·2 answers
  • The Table Design and Layout tabs are available under the
    13·2 answers
  • Select the correct answer from each drop-down menu.
    6·1 answer
  • Use the drop-down menus to complete each statement. Two main versions of Outlook are the desktop app and the app. The has limite
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!