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
Escribe dos diferencias entre las computadoras de la primera y la sexta generacion me pueden ayudar​
Hatshy [7]

Answer:

.N. Generación & Descripción

1

Primera Generación

El período de primera generación: 1946-1959. Base del tubo de vacío.

2

Segunda Generación

El período de la segunda generación: 1959-1965. Base del Transistor

3

Tercera generación

El período de tercera generación: 1965-1971. Circuito integrado de base.

4

Cuarta Generación

El período de cuarta generación: 1971-1980. Base del Microprocesador VLSI.

5

Quinta Generación

El período de la quinta generación: 1980 en adelante. Base del Microprocesador ULSI.

Explanation:

espero y esto te sirva de algo

3 0
2 years ago
6.
HACTEHA [7]
Question 6 west Germany  
3 0
3 years ago
4. How many times will the print statement be executed within the following nested for loops? Briefly explain how or show the ma
HACTEHA [7]

Print statements are used to display outputs

The number of times the nested loop will be executed is 43200

<h3>What are nested for loops?</h3>

Nested for loops are loops that are placed within another loop or loops

From the statement, we have the following loop conditions:

h = 1; h <= 12, m = 0; m <= 59 and s = 0; s <= 59

The above means that:

  • h = 12 --- the outer loop will be executed 12 times
  • m = 60 --- the middle loop will be executed 60 times
  • s = 60 --- the inner loop will be executed 60 times

So, the number of times the nested loop will be executed is:

Count = 12*60 *60

Count = 43200

Hence, the number of times the nested loop will be executed is 43200

Read more about loops at:

brainly.com/question/14284157

8 0
2 years ago
What the defination of electronics capacitor
kotegsom [21]
The definition<span> of a </span>capacitor<span> is a device to store an </span>electronic<span> charge for a short period of time that consists of two metallic plates separated by a dielectric.</span>
8 0
3 years ago
____________________ is the most popular​ open-source program that allows for storage and analysis of big data. A. DBMS B. Hadoo
Vlad [161]

Answer:

B. Hadoop

Explanation:

Hadoop is a collection of open-source software utilities, with this open-source software we can resolve problems with a lot of data, originally was created for computer cluster, but we can find Hadoop in higher-end hardware, this collection was build by Apache Software Foundation, and we can discard SQL Server and Access both are popular but are not open source.

7 0
3 years ago
Other questions:
  • You've decided to use a subnet mask of 255.255.192.0 with your 172.17.0.0 network to create four separate subnets. The network I
    13·1 answer
  • •What are some conflicts between humans and machines that have arisen in the past?
    14·1 answer
  • When planning your educational and career path, it makes sense to consider where you want to work and what type of work you want
    14·1 answer
  • What is used in computer appliances and special-purpose applications, such as an automobile, ATM, or media player and is used fo
    5·1 answer
  • ___________________ are aggregated collections of memory and cpu resources that can be shared among groups of virtual machines o
    11·1 answer
  • The product of two integers is -180 if one of them is 12 find the other​
    14·1 answer
  • Name:
    11·1 answer
  • Write a program asks the user for an integer N and then adds up the first N odd integers. For example, if the user asks the sum
    11·1 answer
  • Outside of a C program, a file is identified by its ________while inside a C program, a file is identified by a(n) ________. fil
    13·1 answer
  • in the future, mobile technologies are expected to be used more than desktop computers today. what other improvements are helpin
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!