Question
*JAVA DATA STRUCTURES* Assignment: Write a program that takes two command line arguments giving the names of the input and output files respectively. Your program
*JAVA DATA STRUCTURES*
Assignment: Write a program that takes two command line arguments giving the names of the input and output files respectively. Your program will read each line of input, parse the tokens, then print each token backwards to the output file on a line by itself. For example, given a file called "in" containing the lines:
abc defg
hi
jkl mnop q
the command (on unix) %FileReverse in out will create a file called out containing lines:
cba
gfed
ih
lkj
ponm
q
The program will contain a recursive method called public static String stringReverse( String s, int n)
This function will return a String that is the reversal of the first n characters of s.
Here's what I have so far. The while loop was supposed to read lines from in, extract, reverse and print tokens from each line.
Any help is appreciated, thanks
public class PileReverse public static String stringReverse (string s, int n) char c [ ] = s . toCharArray ( ) ; for ( int i = 0; iStep 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