Course Solutions Uncategorized (Solved) : Implement C Function Given File Name Creates Map Contains Count Word Map Getcounts String Q35651198 . . . .

(Solved) : Implement C Function Given File Name Creates Map Contains Count Word Map Getcounts String Q35651198 . . . .

 

Implement in C++ a function:

That given a file name it creates a map that contains the countfor each word.

map get_counts(string file_name) {}

Note the removal of the capitalization and punctuation.

and main method:

int main()
{
map r = get_counts(“LOTR.txt”);
cout << “the: ” << r[“the”] << endl;
cout << “lord: ” << r[“lord”] << endl;
cout << “of: ” << r[“of”] << endl;
cout << “rings: ” << r[“rings”] << endl;
cout << “fellowship: ” << r[“fellowship”] <<endl;

cin.get();
}

The output should be:

the: 54
lord: 1
of: 24
rings: 1
fellowship: 1

*Note that the way used to remove punctuation may affect thesenumbers by a small percentage.

Submit your .ccp file (not the .sln file)

content of file:

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Answered) : Paula Williams Currently Completing Design Fo York Ha Automobiles T Total Operatin Automob Q28207632(Answered) : Paula Williams Currently Completing Design Fo York Ha Automobiles T Total Operatin Automob Q28207632

<br/><img src="https://media.cheggcdn.com/media%2F46f%2F46fd94e6-8ed9-40ae-a6e8-4c77ae0f8058%2Fimage" alt="Paula Williams is currently completing the design fo York. She ha automobiles t a total operatin automobiles with the relative frequencies given below. s purchased the land and

(Answered) : Please Please Use Template Conduct Strategic Plan Airline Strategic Plan Establish Purpose Q32124214(Answered) : Please Please Use Template Conduct Strategic Plan Airline Strategic Plan Establish Purpose Q32124214

<p><strong>***PLEASE DO ALL PLEASE****</strong></p><p>Use the template below and conduct a strategic plan for anairline</p><p>The Strategic Plan</p><p>Establish the Purpose (mission, vision statements)</p><p>Analyze the Environments - SWOT</p><p>The External Environment (from industry study)</p><p>Environmental