Question: Write a program that prompts the user to enter the name or path of the file, then will count the number of characters, words,

Write a program that prompts the user to enter the name or path of the file, then will count the number of

Write a program that prompts the user to enter the name or path of the file, then will count the number of characters, words, and lines in a file. Words are separated by white-space characters. And then displays the number of characters, words, and lines in the given file. Here are examples when you run the code: Example 1: Enter file name: test.txt test.txt file has: 170 Characters 22 Words 6 Lines Example 2: Enter file name or path: text.txt Source file text.txt does not exist. Question1.java D ~

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The image contains a text with a programming assignment which asks to write a program that prompts t... View full answer

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 Programming Questions!