Solved by Expert Tutors
Program Description: Make a word search program that searches an input data file for a word specified by the user.
Solved by Expert Tutors
Question

Program Description:<br/><br/><br/>Make 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 such by providing the following functions :


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


void displayResult(string word, int wordCount, int grammaticalCount); (15%)


Both functions should be called from main(). No non-constant global variables should be used. (20%)
************************************************
************************************************
To test the program, make a .dat file with the text below:
************************************************
************************************************
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".

Step-by-step answer

, dictum vitae odi

itur laoreet. Nam

entesque dapibus

sum dolor sit amet,

facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequ

o

ce dui lectus, congue vel laoreet ac, dictum vitae odio. Do

et, consectetur adipiscing elit. Nam lac

s ante, dapibus

ac, dictum vitae odio. Donec aliq

m ipsum dolor sit amet, consectetur adipiscing elit.

fficitur laoreet. Nam risus ante, dapibus a

ec aliquet. Lorem

ac, dictum vitae odio. Donec al

Donec aliquet. Lorem ipsum dolor sit amet, con

sus ante, dapibus a molestie consequa

ec aliquet. Lorem ipsum

nec facilisis. Pellentesque dap

s ante, dapibus

a molestie consequat, ultrices ac magna. Fusce dui lectus, c

molestie consequat, ultrices ac magna. Fusce dui lectus, con

ec aliquet. Lorem

fa

et, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec fac

o

nec facilisis. Pellentesque dapibus efficitur laor

usce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec a

ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae od


o

a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vit

o

ce dui lectus, congue vel laoreet ac, dictum vitae odio. Do

Donec aliquet. Lorem ips

consectetur adipiscing elit. Nam

s ante, dapibus

m ipsum dolor sit amet, consectetur adipiscing elit.

ultrices ac magna. Fusce

ongue vel laoreet ac, dictum vitae odio. Donec

e vel laoreet ac, dictum

ec aliquet. Lorem

iscing elit. Nam lacinia pulvinar tortor n

ac, dictum vitae odio. Donec al

Donec aliquet. Lorem ipsum dolor sit amet, con

sus ante, dapibus a molestie consequa

ec aliquet. Lorem ipsum

nec facilisis. Pellentesque dap

s ante, dapibus

a molestie consequat, ultrices ac magna. Fusce dui lectus, c

Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipisc

ec aliquet. Lorem

o

onec aliqu

o

Donec aliquet. Lorem

Fusce dui lectus, congue vel laoreet ac, dictum

e vel laoreet ac,

amet, co

e vel laoreet ac, dictum vitae odio. Donec a

sum dolor

et, consect

amet, co

icitur laoreet. Nam risus a

, ultrices ac magna. Fusce dui lectus, congue ve

m ipsum dolor sit amet, c

facilisis. Pellentesque dapibus efficitur lao

onec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing e

Fusce dui lectus, congue vel laoreet ac, dictum vitae odio.

ec aliquet. Lorem ipsum dolor

sum dolor

ipiscing elit. Na

o

acinia pulvi

countwords.PNG

countwords.PNG
r

Subscribe to view the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question