@@ -0,0 +1,2162 @@
+//*****************************************************************************%0A//    Filename: ScoresToFile.java%0A//%0A//      Author: David C. Drake (http://davidcdrake.com)%0A//%0A// Description: Contains a ScoresToFile class for writing exam and lab scores,%0A//              provided by the user, to a file.%0A//*****************************************************************************%0A%0Aimport java.io.*;%0A%0Apublic class ScoresToFile%0A%7B%0A  public static void main(String%5B%5D args) throws IOException%0A  %7B%0A    final int NUM_EXAMS = 2,%0A              NUM_LABS = 11;%0A%0A    String filename = %22scores.txt%22,%0A           name;%0A    BufferedReader stdin = new BufferedReader%0A      (new InputStreamReader(System.in));%0A    FileWriter fw = new FileWriter(filename);%0A    BufferedWriter bw = new BufferedWriter(fw);%0A    PrintWriter outFile = new PrintWriter(bw);%0A    int%5B%5D exam = new int%5BNUM_EXAMS%5D,%0A          lab = new int%5BNUM_LABS%5D;%0A    int i;%0A    boolean error;%0A%0A    System.out.print(%22Name: %22);%0A    name = stdin.readLine();%0A    outFile.println(%22Name: %22 + name + %22%5CtNo. of exams: %22 + NUM_EXAMS +%0A                    %22%5CtNo. of labs: %22 + NUM_LABS + %22%5CnExam scores: %22);%0A    for (i = 0; i %3C NUM_EXAMS; i++)%0A    %7B%0A      do%0A      %7B%0A        error = false;%0A        try%0A        %7B%0A          System.out.print(%22Exam %22 + (i + 1) + %22: %22);%0A          exam%5Bi%5D = Integer.parseInt(stdin.readLine());%0A        %7D%0A        catch (NumberFormatException exception)%0A        %7B%0A          System.out.println(%22%5CnERROR: Invalid input.%5Cn%22);%0A          error = true;%0A        %7D%0A      %7Dwhile (error);%0A      outFile.print(exam%5Bi%5D + %22 %22);%0A    %7D%0A    outFile.println(%22%5CnLab scores: %22);%0A    for (i = 0; i %3C NUM_LABS; i++)%0A    %7B%0A      do%0A      %7B%0A        error = false;%0A        try%0A        %7B%0A          System.out.print(%22Lab %22 + (i + 1) + %22: %22);%0A          lab%5Bi%5D = Integer.parseInt(stdin.readLine());%0A        %7D%0A        catch (NumberFormatException exception)%0A        %7B%0A          System.out.println(%22%5CnERROR: Invalid input.%5Cn%22);%0A          error = true;%0A        %7D%0A      %7Dwhile (error);%0A      outFile.print(lab%5Bi%5D + %22 %22);%0A    %7D%0A    outFile.println();%0A    outFile.close();%0A    System.out.println(%22%5CnData saved to: %22 + filename);%0A  %7D%0A%7D%0A

Add ScoresToFile.java