Question: need help on C++ program please!!! Lab Assignment: 1. You will generate all of the code for this assignment, so begin by creating a new

need help on C++ program please!!!

need help on C++ program please!!! Lab Assignment: 1. You will generate

Lab Assignment: 1. You will generate all of the code for this assignment, so begin by creating a new project with your driver file named 'main.cpp.' Then add functions that allow vou to read and write strings from/to a file. 2. Then, take the words that you read in from the example.txt that was provided in the repo and tally the strings in the file by inserting those strings into a map object. Here, the string part of the map will be the individual words read in from the file, and the int portion of the map is the number of times the string part has been inserted in the map. (Hint: figure out what the statement ++tally[item]; does when tally is a map and item is a string) Behind the scenes, the map container stores objects in a balanced binary search tree(research what it means for a tree to be balanced). The map iterator uses an inorder traversal to step through the tree objects, so the objects accessed by the iterator are encountered in sorted order. Think back to last lab and the three different traversal methods we discussed(pre/post/inorder) 3. Iterate through the tally map and write each string the correct number of times to the output file named output.txt. This means that the size of the output file will be the exact same as the input file but the words in output.txt will be sorted

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!