Question: Part B: (String) Program Description: Write a word search program that searches an input data file for a word specified by the user. The program

Part B: (String)

Program Description:

Write a word search program that searches an input data file for a word specified by the user. The program should display the number of times the word appears in the input data file. In addition, the program should count and display the number of grammatical characters in the input data file. Your program must do this by providing the following functions :

void processFile(ifstream &inFile, string wordSearch, int &wordCount, int &grammaticalCount) ; (15%)

void displayResult(string word, int wordCount, int grammaticalCount)

Both functions should be called from main(). No non-constant global variables should be used.

Test your program using the file provided paragraph.dat.

The program file named paragraph.dat contains the following:

You'll generally read and write longer paragraphs in academic papers. However, too many long paragraphs can provide readers with too much information to manage at one time. Readers need planned pauses or breaks when reading long complex papers in order to understand your presented ideas. Remember this writing mantra: "Give your readers a break!" or "Good paragraphs give one pause".

c++

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!