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
How can I download music and films at home without breaking the law?
mina [271]

Answer: use a legal music downloader

Explanation: :)

5 0
2 years ago
Read 2 more answers
A collection of related instructions organized for a common purpose is referred to as
marshall27 [118]
Computer or data. Lol
5 0
3 years ago
Read 2 more answers
Sam has created a fashion website. There are many subscribers to his website. He has added new blogs, pictures, and articles abo
marusya05 [52]

Answer:

Post advertisements on social media and message the subscribers.

Explanation:

There is no point in not promoting and putting forward the work that he has been doing. All of the given options are about promoting the content but Sam needs to choose the ones which are efficient and seem professional as well.

Posting advertisements about the website promotes the content on a wider base and helps in luring more and more people to the website.

Messaging or sending an email to the subscribers is a healthy of letting the subscribers about the updates and latest posts.

8 0
3 years ago
Alexa hoped that a good outline will accomplish which of the following for her<br> presentation?
atroni [7]

Answer: A. Help her distinguish between main topics and subtopics.

Explanation: APEX

6 0
3 years ago
Read 2 more answers
Desinated for a network connection within a largecity or multiple small citys
frozen [14]

I think it is WAN (Wide Area Network).

6 0
2 years ago
Other questions:
  • What is the easiest way to be sure you have selected all of the content related to a specific tag?
    11·1 answer
  • What three conditions must be satisfied in order to solve the critical section problem?
    13·1 answer
  • Which is the correct sequence of steps for opening a new document?
    10·2 answers
  • Choose the reasons why Windows Server operating systems are a popular choice for a network because they _____. Select all that a
    12·1 answer
  • PLEASE HELP
    15·2 answers
  • Point out the correct statement.
    11·1 answer
  • Most hard drives are divided into sectors of 512 bytes each. Our disk has a size of 16 GB. Fill in the blank to calculate how ma
    9·1 answer
  • Explain<br> the three types of periodic<br>maintanance. .​
    10·1 answer
  • What layer of the OSI model describes how data between applications is synced and recovered if messages don't arrive intact at t
    12·1 answer
  • Explain the different type of shift register counter ​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!