Question: Problems Write a text analyzer program that will read any text file. The program is to print a menu that gives the user the options
Problems Write a text analyzer program that will read any text file. The program is to print a menu that gives the user the options of counting lines, words, characters, sentences (one or more words ending in a period), and an option to search for a word in the file. At the end of the analysis, write an appropriate report according to user's option. Requirements .Use a separate function for each option. . The name of the text file should be entered from the user in the main function. The file should be opened in main function too and passed to each function. So a function, for example, can be declared as void linesCounter (ifstream &fsIn, int &countLn) ; The function that searches for a specified word (a string) should search the file for every occurrence of the word. The function counts the number of times the word appeared in the file and records each line number the word appeared in the file. To record the line numbers, you may use an integer array Input . File name An option of the menu A word to search for Output An analysis report for the user's option
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
