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
Helen [10]
3 years ago
10

7.14 LAB: Word frequencies Write a program that reads a list of words. Then, the program outputs those words and their frequenci

es. The input begins with an 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 arrays, one array for the strings and one array for the frequencies.

Computers and Technology
1 answer:
Anastasy [175]3 years ago
4 0

Answer:

See explaination

Explanation:

Below is the program code;

import java.util.Scanner;

public class LabProgram {

public static void main(String[] args) {

Scanner in = new Scanner(System.in);

int n = in.nextInt();

String[] words = new String[n];

for (int i = 0; i < words.length; i++) {

words[i] = in.next();

}

int count;

for (int i = 0; i < words.length; i++) {

count = 0;

for (int j = 0; j < words.length; j++) {

if (words[i].equals(words[j])) {

++count;

}

}

System.out.println(words[i] + " " + count);

}

}

}

Please kindly check attachment for the output.

You might be interested in
Which app is not a free app that your Microsoft account gives you access to
Ilya [14]

I believe the answer is Microsoft Office, Correct me if I'm wrong.

Really hope this helps!

5 0
3 years ago
Text that is heavier or darker than other text in the document is considered _____.
kvv77 [185]

The text that is heavier or darker than other text in a document is considered  Bold.

Hope this helped!~

7 0
3 years ago
Read 2 more answers
When you use the Filter feature, what appears in each column label
Scrat [10]
<span>an arrow  ..............................</span>
5 0
3 years ago
What are the oop concept of java
mash [69]

Answer: OOP concepts in Java are the main ideas behind Java’s Object Oriented Programming. They are abstraction, encapsulation, inheritance, and polymorphism. Grasping them is key to understanding how Java works. Basically, Java OOP concepts let us create working methods and variables, then re-use all or part of them without compromising security.

HOPE THIS HELPED IS NOT SORRY.

4 0
2 years ago
Read 2 more answers
The answer for 1 and 2
Mrrafil [7]
1. A.  It is basically the definition of a political cartoon.
2. D. They used newspaper, protesting, and marches.
<span />
6 0
3 years ago
Other questions:
  • Numeric data is stored in what for direct processing
    5·1 answer
  • In computer logic what is order of instructions
    13·1 answer
  • A(n) ____ string contacts the data source and establishes a connection with the database using the Data Source Configuration Wiz
    5·1 answer
  • David owns a retail business that just implemented a web app to supplement sales. He needs to choose an attribution partner to i
    15·1 answer
  • One of the most common uses of spreadsheet are
    8·1 answer
  • At each layer of the OSI model, data is appended to the original message and then sent on to the next lower layer. What is this
    10·1 answer
  • Which of the following is a public location that sells Internet access? Internet café Extranet Intranet LogMeIn,
    15·1 answer
  • Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integer
    9·1 answer
  • Phishing is ____________. When hackers overwhelm a website with too many requests. A network of private computers infected with
    7·1 answer
  • ..............................................................................
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!