Question
Write a Java program that 1. Use a Scanner class to select a text file from your computer in a way that works with Windows.
Write a Java program that 1. Use a Scanner class to select a text file from your computer in a way that works with Windows.
2. Reads the selected text file. The text file for my test will consist of one or more rows, each row containing one or more strings of characters, separated by spaces. The strings themselves will consist of printable, non-space characters.
3. Writes the final string of each input line to a separate line on the output file, and also writes the string to the standard output (console). The output text file must be in the same directory as the input text file, where the naming convention is as follows: If the input file is abc.txt, the output file is abc_out.txt
sample input:
the sun and the moon
123 456
sample output
moon
456
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started