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
Search engine bing offers
scoundrel [369]
Bing offers work pretty good, I have gotten the rewards a couple of times
6 0
4 years ago
I've been stuck on these two basic javascript assignments for an embarrassingly long time. The teacher refuses to help me and th
user100 [1]

Answer:

it is 29 0ver 30

Explanation:

i took the quiz

5 0
3 years ago
When a new version of a system is installed, the prior release is _____, or stored.​?
Firlakuza [10]

<span><span>Version control is the process of tracking system releases or versions</span>.
When a new version of a system is installed, the prior release is archived, or stored.​</span>
<span> Version Archive is a repository of all entries which have ever appeared .
</span>Each change is documented and installed as a new version of the system called a maintenance release .

7 0
3 years ago
In which phase of website design does the designer create a mock-up aimed at the target user? A. learning B. planning C. design
IgorC [24]

Answer:

C. design

Explanation:

HTML is an acronym for hypertext markup language and it is a standard programming language which is used for designing, developing and creating web pages.

Generally, all HTML documents are divided into two (2) main parts; body and head. The head contains information such as version of HTML, title of a page, metadata, link to custom favicons and CSS etc. The body of the HTML document contains the contents or informations that a web page displays.

In the design phase of a website design, the website designer create a mock-up aimed at the target user. A mock-up is a graphical representation or illustration of a graphic design and as such isn't responsive.

This ultimately implies that, a mock-up or model can be used by a website designer to illustrate or show the target user the look and feel of a website, so as to help these users have a better understanding of the specific elements and structure associated with it.

5 0
3 years ago
1.A tachometer measures:
Art [367]
1. D


2. D


I hope I helped :)
3 0
3 years ago
Other questions:
  • What does computer means?
    13·2 answers
  • A compound boolean expression created with the ___ operator is true only if all its connected expressions are true.
    14·1 answer
  • What is the name of the process that weighs the alternatives, gathers all necessary information, and can ultimately lead you to
    9·2 answers
  • identify at least three additional ethical responsibilities expected from a computer professional. In brief, explain each respon
    11·1 answer
  • Which technique is used to convert a color image to a black and white image?
    12·1 answer
  • What does SFA software provides tools for
    11·2 answers
  • A social cause is: O A. when one person protests without the support of others. B. something that not many citizens think or car
    8·1 answer
  • You designed a program to create a username using the first three letters from the first name and the first four letters of the
    6·1 answer
  • Which of the following is an example of how the respiratory system interacts with the circulatory system to excrete waste?
    6·1 answer
  • Which family does Ms word 2007 belongs to?​
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!