Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Could somebody help me out? Thanks! optics.csufresno.edu Google Search . 365 HOMEWORK #22-File Parser Write a program that numbers the lines found in a text

image text in transcribed
image text in transcribedCould somebody help me out? Thanks!
optics.csufresno.edu Google Search . 365 HOMEWORK #22-File Parser Write a program that numbers the lines found in a text file and keeps tracks of the character statistics of the file. The program should read text from the file and output each line to the screen, preceded by a line number. Also keep track of the number of paragraphs, the total line count, the total word count, the total character count, the alpha character count, the non-alpha character count, and the white space count. The sum of the alpha, non-alpha, and white space characters should be equal to the total character count in the file. Specifications: Use the "bob.txt" as the input file once again. The function prototype for your computations should be: void fileParser (ifstream &file) The function should perform all necessary computations and print the results to the screen. Print the line number at the start of the line, right justified in a field of three spaces. Follow the line number with a colon, a single space, and the line of text. The only purpose of the main function is to open the file, exit the program if the file fails to open, call the fileParser) function, and close the file. As an example, if you execute the program with the following underlined inputs, the output will be: - main.o 1: Bob 3: I, man, am regal a German am I 4: Never odd or even 5: If I had a hi-fi 6: Madam, I'm Adam 7: Too hot to hot 8: No 1emons, no melon 9: Too bad I hid a boot 10: lisa Bonet ate no basil 42: God! A red nugget! A fat egg under a dog! 43: Go hang a salami, I'm a lasagna hog

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft SQL Server 2012 Unleashed

Authors: Ray Rankins, Paul Bertucci

1st Edition

0133408507, 9780133408508

More Books

Students also viewed these Databases questions

Question

What is the growth rate of GDP per capita?

Answered: 1 week ago