Question: In Java Please You are presented with 3 different text files. File 1 . txt , File 2 . txt , and File 3 .

In Java Please
You are presented with 3 different text files. File1.txt, File2.txt, and File3.txt. You will be tasked with taking each line of the file and reversing it. Write the reversed file to output.txt.
You will need to create a scanner to detect the following input "File1.txt" or "File2.txt" or "File3.txt". Then open the file whose name was passed in as input. And take its contents, flip them, then right them to output.txt
For example, say you have the following File1.txt and you provide as input to your program "File1.txt"
Hello this is a file that should be reversed.
Be sure to check each line in the file.
This is because this file is three lines.
You should create a file output.txt containing the following
.desrever eb dluohs taht elif a si siht olleH
.elif eht ni enil hcae kcehc ot erus eB
.senil eerht si elif siht esuaceb si sihT
Thank you

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