I wrote this code to access a file for input, but now i need to make the input into an output converting all characters to upper.
import java.util.Scanner; import java.io.*; public class IoDemo { public static void main(String[] args) throws IOException { //Create scanner object Scanner keyboard = new Scanner(System.in); //Get file name System.out.println("Enter the name of the input file: "); String filename = keyboard.nextLine(); //open the file File file = new File(filename); Scanner inputFile = new Scanner(file); //Close the file inputFile.close(); } }
the planned output should go:
thats all that the program will display but it turns the text in the input file into a new output file that is now all upper.Enter the name of the input file: quotations.txt
Enter the name of the output file: allupper.txt
How do I write the code to directly create a new text file while turning all the text into uppercase?