Question: Part 1: For the first step of the project, implement in C++ a function: map get_counts(string file_name) {} file name: textFile.txt Early to bed and

Part 1: For the first step of the project, implement in C++ a function: map get_counts(string file_name) {}

file name: textFile.txt Early to bed and early to rise makes a man healthy, wealthy, and wise. I think, therefore I am. It does not matter how slowly you go so long as you do not stop. Love the life you live. Live the life you love. **Note the removal of the capitalization and punctuation**

int main() { map r = get_counts("testFile.txt"); cout << "early: " << r["early"] << endl; cout << "you: " << r["lyou"] << endl; cout << " love: " << r["love "] << endl; cout << " the: " << r["the "] << endl; cin.get(); }

The output should be:

early: 2 you: 4 love: 2 the: 2

Note that the way used to remove punctuation may affect these numbers by a small percentage. Submit your .ccp file (not the .sln file)

Thank you!!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!