Question: 28 FILL in the missing lines of code to send output to a separate file called infoOutput.t import java.io.PrintWriter; import java.io.FileNotFoundException; import java.util.Scanner public class
28 FILL in the missing lines of code to send output to a separate file called infoOutput.t import java.io.PrintWriter; import java.io.FileNotFoundException; import java.util.Scanner public class TextFileOutputDemo public static void main(String[] args) String fileName-" try "Jassigns the correct file to fileName outputStream = null; new Print Writer(fileName):/lassigns your created Print Writer to new... catch(FileNotFoundException e) System.out.println"Error opening the file "+fileName); System.exit(O) System.out.println"Enter 3 test scores:"); Scanner keyboard-new Scanner(System.in); int sum 0; for(int count l;count-3:count++) int score-keyboard.nextlntO sum+ score; ://prints count number and test to file /prints the average to the file :/closes file System.out.println("Those names were sent to "+fileName)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
