Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

General Description: You will write a program that reads a text file, counts the

ID: 3555776 • Letter: G

Question

General Description: You will write a program that reads a text file, counts the number of words in the file, and the number of occurrences of each character. It will print to a file the number of words, and the number of occurrences of each character, as well as the percentage of that particular character as compared to all the characters. The list should be in descending order of occurrence.

Details:

The body of the main function will only have variable declarations and function calls. (and the

Explanation / Answer

#include #include // A map will be used to count the words. #include // Will be used to read from a file. #include // The map's key value. using namespace std; //Will be used to print the map later. template void PrintMap(map map) { typedef std::map::iterator iterator; for (iterator p = map.begin(); p != map.end(); p++) cout