Overview: We will take a book and count how many words start with each letter. We will also make a set of result files that store all words starting with each letter.
Review the ASCII character codes for this lab ASCII Table
Read about how files work in C++ https://www.tutorialspoint
Create a new file lab6.cpp.
Write a function int starts_with_letter(string filename, char letter) that takes a file and writes all the words that start with the given letter into a file. The function returns the number of words it put into the file.
Here is an outline for how your function should work.
Hints: Use ASCII codes to account for both upper and lower case letters. The below code shows you how to generate a file name to use.
Write your main program. Ask the user for the name of a file. Open the file and count how many words starting with each letter A-Z appear. The output is the total number of words that start with each letter. The program should also make a file for each letter with the actual words found, one word per line. When the program exists, you should have 26 new files with results. (See Attached Example File)
Go to Project Gutenberg and download a plain text copy of "Fundamental Principles of the Metaphysic of Morals" by Immanuel Kant. Run your program on it. Books from Project Gutenberg have copyright and additional material at the beginning and end, just leave this in the file as it is for this lab