Question: 7.4 LAB: Counting chars, words, and lines ir Write a program that asks the user for a file name and prints the number of characters,

 7.4 LAB: Counting chars, words, and lines ir Write a program

7.4 LAB: Counting chars, words, and lines ir Write a program that asks the user for a file name and prints the number of characters, words, and lines in that file. Ex: If the input file contains: Mary had a little lamb Whose fleece was white as snow. And everywhere that Mary went, The lamb was sure to go! the output is: The file contains 110 characters, 22 words and 4 lines You will need to prompt the user for the input file name and then use a for loop to traverse the file. Use Sections 7.2.2 and 7.2.3 in your textbook for reference

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!