Question: Write a program that asks a user for a file name and prints the number of characters, words (separated by whitespace), and lines in that

Write a program that asks a user for a file name and prints the number of characters, words (separated by whitespace), and lines in that file. Then, it replaces each line of the file with its reverse. For example, if the file contains the following lines (Test1.txt):

This is a test

Hi there

Output on the console:

Number of characters: 22

Number of words: 6

Number of lines: 2

Data written to the file (Test1.txt):

tset a si sihT

ereth iH

Save the source code in FileReverseWord.java. "Need a java program asap"

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!