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
Elina [12.6K]
3 years ago
8

Write a program that reads a list of words. Then, the program outputs those words and their frequencies. If the input is 5 hey h

i Mark hi mark (the first number indicates the number of words that follow), the output is:
hey 1
hi 2
Mark 1
hi 2
mark 1

Hint: Use two vectors, one for the strings, another for the frequencies.

Your program must define and use the following function: int GetFrequencyOfWord(vector wordsList, string currWord)
Computers and Technology
1 answer:
zysi [14]3 years ago
4 0

Answer:

/ declare the necessary header files.

#include <iostream>

#include <string>

#include <vector>

using namespace std;

// declare the main function.

int main()

{

// declare a vector.

vector<string> words;

vector<int> counts;

// declare variables.

int size;

string str;

cin >> size;

// start the for loop.

for(int i = 0; i < size; ++i)

{

// input string.

cin >> str;

words.push_back(str);

}

// start the for loop.

for(int i = 0; i < size; ++i)

{

int count = 0;

// start the for loop.

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

{

// check the condition.

if(words[j] == words[i])

{

count++;

}

}

counts.push_back(count);

}

// start the for loop.

for(int i = 0; i < size; ++i)

{

// display result on console.

cout << words[i] << "\t" << counts[i] << endl;

}

return 0;

}

Explanation:

You might be interested in
75,15,25,5,15 what's next
Fittoniya [83]

Answer:

3

Explanation:

The sequence seems to follow a 2-step pattern.

1)Divide the first number by 5 to get the second number.

2)Add 10 to the second number to get the third number.

75/5 = 15

15 + 10 = 25

25/5 = 5

5 + 10 = 15

---> 15/5 = [3] (Answer)

3 0
2 years ago
You have been given a laptop to use for work. You connect the laptop to your company network, use it from home, and use it while
VashaNatasha [74]
  • You can get a antivirus subscription that will kill malwares
  • Also, you can avoid going on websites you don't trust
  • I hope this helps you.
4 0
2 years ago
Data silos are often associated with ________________.
amid [387]

Answer:

Option b the development of one or a few related analytics applications.

Explanation:

Data silo is the isolated information in an organization which is not shared across different departments. Data silo could exist because one department in an organization may not see the necessity to share information to other department. Or the information is deemed as unique data which is dedicated  to develop one or a few very specific analytics applications.  Data silos should be minimized if an organization intends to develop a data analytics system that support in enterprise wide level.

7 0
3 years ago
Name the type of software which provides the user interface. [1 mark
Inessa [10]

Explanation:

user interface, also sometimes called a human-computer interface, comprises both hardware and software components. It handles the interaction between the user and the system.

There are different ways of interacting with computer systems which have evolved over the years. There are five main types of user interface:

command line (cli)

graphical user interface (GUI)

menu driven (mdi)

form based (fbi)

natural language (nli)

7 0
2 years ago
Describe types of hardware used for output​
sashaice [31]
A computer output device is used to extract information from a computer. There are visual, audio, print and data output devices. Different types of specific hardware include monitors, speakers and headphones, printers and external hard drives.
3 0
3 years ago
Other questions:
  • What car dealership websites did you use to conduct your research?​
    8·1 answer
  • A plan that outlines the steps and timeline for reaching a certain goal is called a(n):
    13·1 answer
  • When Clara accesses the programs and documents on her computer by way of icons, she is said to be employing
    15·1 answer
  • Which of the following is a scam in which a perpetrator sends an official looking e-mail that attempts to obtain a user’s person
    7·2 answers
  • From your computer you are able to establish a telnet connection to a remote host but a traceroute to the host IP address result
    6·1 answer
  • Need help please. this effect my technology
    15·1 answer
  • Name all mario kart games in order
    15·2 answers
  • Robyn needs to ensure that a command she frequently uses is added to the Quick Access toolbar. This command is not found in the
    9·1 answer
  • Please don't guess answer for points!!
    10·2 answers
  • 1. If an android phone is out of date or outdated and it requires an update. Explain the steps how I can update this phone.
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!