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
Keith_Richards [23]
2 years ago
10

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

n integer indicating the number of words that follow. Assume that the list will always contain fewer than 20 words. Ex: If the input is: 5 hey hi Mark hi mark the output is: hey - 1 hi - 2 Mark - 1 hi - 2 mark - 1 Hint: Use two vectors, one vector for the strings and one vector for the frequencies.
Computers and Technology
1 answer:
tekilochka [14]2 years ago
5 0

Answer:

The following are the program to the given question:

import java.util.*;//import package for user input

public class Make  //define class Make

{

public static void main(String[] ask)  //define a main method

{

  Scanner obx = new Scanner(System.in);   //declare the Scanner class object

  int size=obx.nextInt(); //get the size of the array from the user

  int a[]=new int[size]; //declare an integer array with given size

  String word[]=new String[size]; //declare a string array with given size

  for(int i=0;i<size;i++) //set the for loop  

  word[i]=obx.next(); //get string input from the user

  for(int i=0;i<size;i++)   //iterates with the array, increase the count

  {

    for(int j=0;j<size;j++)   //defining a loop to check value

    {

      if(word[i].equals(word[j]))  //use if to check that elements of words          

      a[i]++;//increamenting array size

    }

  }

 System.out.print("\n");  //use print for break line  

  for(int i=0;i<size;i++)//set for loop to print the following result

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

 }

}

Output:

Please find the attachment file.

Explanation:

  • First, establish the predefined package required and instead define the main class and define the main method within the class and method.
  • Declare the scanner class object and receive an object size in the 'size' variable thru the array.
  • Next create two arrays, the integer type "a" with both the input size given and the string type "word" with the input size supplied.
  • Define the loop for which string array elements are acquired and set two to again for loop, which increases with loop iteration the integer data type array by one.
  • Lastly, set the loop for which this result is printed.

You might be interested in
A company has a file server that shares a folder named Public. The network security policy specifies that the Public folder is a
klasskru [66]

Answer:

authentication

Explanation:

At the authentication process, there is a way of identifying a user, this is typically done by having the user enter a valid user name and valid password before access is granted. Here at authentication the process is based on each user having a unique set of criteria for gaining access.

The AAA server have to ascertain by comparing a user's authentication credentials with other user credentials stored in a database. In the event the credentials match, the user is granted access to the network. But on the other hand, If the credentials varies, and authentication fails then network access will be denied.

3 0
3 years ago
Which types of networks cover large geographical areas such as several states? PAN
aleksley [76]

MAN

Explanation:

Metropolitan Area Network

Local Area Network

Wide area Network

7 0
2 years ago
To format an individual sparkline, select the sparkline you want to format, and then click the Ungroup button in the Group group
vichka [17]

Answer:

The answer is "Option a"

Explanation:

A Sparkline is a small graph, which is available inside a sheet, that displays information visually. It displays the information is in the form of patterns on several values. It also uses underline to display the low and high value, use with sparklines, and certain alternatives were wrong, which can be defined as follows:

  • In option b, It is used to define the overall view of data, that's why it is wrong.
  • Option c and Option d both are wrong because, create command is used to create data, or view is used to show that data, they both don't use sparkline option.  
3 0
3 years ago
BI is an umbrella term that combines architectures, tools, databases, analytical tools, applications, and methodologies. b. BI i
torisob [31]

Answer:

architectures, tools, databases, analytical tools, applications, and methodologies

Explanation:

There are several features of business intelligence. It is a content-free expression, which means that it means different things to different people, and not same thing as suggested by Option B. While its major objective is to enable or allow easy access to data, it is not limited to data and IT only as suggested by Option C. Instead it provides managers of businesses with the ability of analysis of data. And finally it helps in the transformation of data to information and to action, which is contrary to the suggestions of Option D. Hence the first option is the only correct option.

3 0
3 years ago
When code is compiled it
lesantik [10]

Answer:

A compiler takes the program code (source code) and converts the source code to a machine language module (called an object file). Another specialized program, called a linker, combines this object file with other previously compiled object files (in particular run-time modules) to create an executable file. In short, it's A or D.

5 0
3 years ago
Read 2 more answers
Other questions:
  • I have a question about a hotel tv:
    10·1 answer
  • What is the left are if a slide in a presentation called
    15·1 answer
  • Which of the following describes the function of a web browser?
    11·1 answer
  • Professionalism is defined as what?<br> ASAP PLEASE!
    11·1 answer
  • When a company sends you recommendations of what to buy you know that :
    12·1 answer
  • the volume of two similar solids are 1080cm and 1715cm .if the curved surface area of the smaller cone is 840cm .fond the curved
    5·1 answer
  • 1- pensamiento sistémico<br>2- visión oriental y occidental​
    8·1 answer
  • (C) Describe about the different types of computer<br> peripherals and memory devices.
    9·1 answer
  • Which of the following is not considered essential for an electronic device to be called a computer?
    15·1 answer
  • before you start researching fleet management software, your first task is to clearly define the problem. this will help guide y
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!