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
Special computers, called __________, keep databases of IP addresses and their corresponding names
vitfil [10]
Name servers.
-----------------------------------------------------------
4 0
2 years ago
Angelina wants to modify the footer in her report so the page numbers are correct. To do this, she first double-clicks the foote
Mkey [24]

Answer:

Click Page Number, Click Current Position, Click Plain Number 1.

Explanation:

Just did it, e2020

4 0
3 years ago
How to order reference list in apa format?
Brums [2.3K]
<span>Title. Label this page References, centered in plain text.Spacing. Make sure to double space throughout.Order. List the sources in alphabetical order by the authors' last names. ...<span>Indentation. Do not indent the first line in the citation; however, you must indent any additional lines 5 spaces in the citation.</span></span>
5 0
3 years ago
You plan to use the Fill Down feature on a formula and you need to keep a cell reference the same. Which of the following format
yKpoI14uk [10]
A $E19 I now it because I am in college
6 0
3 years ago
Read 2 more answers
Consider the folloeing website URL:http://www.briannasblog.com. What does the "http://" represent?
Alex Ar [27]

i believe the answer would be (A) because HTTPS stands for Hypertext Transfer Protocol


6 0
2 years ago
Other questions:
  • You have found statistics on the Internet that you would like to use in your speech.
    6·1 answer
  • Which of the following is NOT a fixed expense?
    6·1 answer
  • Which is true about TCP and UDP? Choose two answers.
    15·1 answer
  • Technician A says that front and rear U-joints on a RWD axle should operate at different angles to prevent vibration. Technician
    10·1 answer
  • Select the correct answer from each drop-down menu.
    7·2 answers
  • What will happen when you drag and drop a worksheet tab into another workbook WITHOUT holding the Ctrl key down?
    13·2 answers
  • How tp access to all tools in ms word
    10·1 answer
  • Which of the following is the biggest issue facing wireless communication today?
    5·1 answer
  • Computer always produces wrong output true or false<br>​
    7·1 answer
  • Jason is the motion picture projectionist at the local IMAX theater. This means that he runs the huge movie projector so that cu
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!