Write a program that reads a list of words. Then, the program outputs those words and their frequencies. The input begins with an integer indicating the number of words that follow. 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 vectors, one for the strings, another for the frequencies. Your program must define and use the following function:int GetFrequencyOfWord(vector<string> wordsList, string currWord) #include <iostream>#include <vector> #include <string>using namespace std; /* Define your function here */ int main() {/* Type your code here */ return 0;} Please help me with this problem using c++.

Question

Write a program that reads a list of words. Then, the program outputs those words and their frequencies. The input begins with an integer indicating the number of words that follow.

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 vectors, one for the strings, another for the frequencies.

Your program must define and use the following function:
int GetFrequencyOfWord(vector<string> wordsList, string currWord)

#include <iostream>
#include <vector>
#include <string>
using namespace std;

/* Define your function here */

int main() {
/* Type your code here */

return 0;
}

Please help me with this problem using c++.

Expert Answer

1 Rating

Want to see the step-by-step answer?

Check out a sample Q&A here.

Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

*Response times vary by subject and question complexity. Median response time is 34 minutes and may be longer for new subjects.

Related Computer Science Q&A

Find answers to questions asked by students like you.

Q: First, launch NetBeans and close any previous projects that may be open (at the top menu go to File ...

A: The Java program and the program plan to calculate the average of the elements of three rows of a 2-...

Q: In C++, I have seen this line of code: while(cin.get() != '\n'); What does this mean/do?

A: ⦁ Start from cin.get() method, get() is a method which is called and which has inbuilt one argument ...

Q: Given the following business rules, define the relationships between entities and identify cardinali...

A: Entity-Relationship (ER) diagram:The following ER diagram defines the cardinalities and relationship...

Q: If originally x = 4, y = 0, and z = 2, which is the value of x, y and z after executing the followin...

A: Code(in Java)-class Main{            public static void main(String[] args)            {            ...

Q: C++ program IF NOT COMFORTABLE WITH CLASSES,I WOULD START WITH DEFINING THE CLASS WITH ONE constru...

A: The implementation for the given criteria is as follows,File name: “student2.h”#include&lt;iostream&...

Q: What are the SQL query commands to create the tables (attached) with appropriate attributes and data...

A: Primary key:A primary key, also referred to as a primary keyword, is a key in a relational database ...

Q: Is Amazon Web Services an enterprise application integration (EAI) system?

A: “Yes”, Amazon Web Services (AWS) provides many default connectors to provide integration of many app...

Q: If a non-key column determines a key column, which normal form is violated?A) 1NFB) 2NFC) 3NFD) BCNF

A: BCNF:Boyce – Codd Normal Form (BCNF) is based on functional dependencies that in a relationship all ...

Q: A contact list is a place where you can store a specific contact with other associated information s...

A: The below given C++ program will obey the following rubrics:Importing essential header files.Definin...