Write a method named doublespace that accepts


Write a method named doubleSpace that accepts a Scanner for an input file and a PrintStream for an output file as its parameters, writing into the output file a double-spaced version of the text in the input file. You can achieve this task by inserting a blank line between each line of output.
_____________________________________________________________
this is what i got
import java.io.*;
import java.util.*;

public class DoubleSpace{
public static void main(String[] args)
throws FileNotFoundException{

}

public static void doubleSpace(Scanner input, PrintStream output)
throws FileNotFoundException {
// read the input file and store as a long String
String output = "";
Scanner input = new Scanner(new File("inFile.txt"));
while (input.hasNextLine()) {
output += input.nextLine() + "nn";
}
input.close();

// write the doubled output to the outFile
PrintStream out = new PrintStream(new File("outFile.txt"));
out.print(output);
}

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: Write a method named doublespace that accepts
Reference No:- TGS096634

Expected delivery within 24 Hours