Write a program that reads a text file selected


Name your source file: "exercise2.cpp"
Write a program that reads a text file selected by the user and prints a report on the screen indicating how many lines of text were read, how many words were read, how many total characters were read,how many vowels were read, how many consonants were read, and how many whitespace characters were read. The user must be able to enter the name of the file. Allow the user to reenter the filename
whenever the file specified cannot be opened. Assume that vowels are the uppercase or lowercase letters a, e, i, o, and u. For the purposes of this program a word is a sequence of one or more letters or digits followed by any other character than a letter or digit. For example, here is the output produced by a program that satisfies the requirements of this assignment when run on the file named "input1.txt".

input1.txt contains the following content:
Peter Peter pumpkin eater,
Had a wife and could not keep her!

He put her in a pumpkin shell,
And there he kept her very well!

---------------------------------------------------------------
your program should run something like this:

Enter input file name: input1.txt

The 6 lines of text contained:
26 words
127 characters
36 vowels
60 consonants
27 whitespace characters

Read more: Name your source file: "exercise2.cpp" 

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: Write a program that reads a text file selected
Reference No:- TGS097531

Expected delivery within 24 Hours