Here is my prompt for the assignment: Your program needs to read the information from a text file instead of using a scanner to read from command line. Your program also ne
like @Shobit said previously, use a BufferedWriter in conjunction with a FileWriter and with the methods write() and newLine() you can insert the lines you want to the file in stead of using Println.
BufferedWriter writer = new BufferedWriter(new FileWriter("path-of-file")); //you don't need to create a File object, FileWriter takes a string for the filepath as well
writer.write("Student number...");
writer.writeLine(); //for a new line in the file
and when you are done writing to the file,
writer.close();