Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Adding sorted data to info string.
//assign empty value to info string variable
writeFile = "";
//start try block
// Set up the output file stream
PrintWriter outFile = new PrintWriter(new PrintStream(new File("GradeReport.txt")));
// Print a header to the output file
outFile.printf("Student Test1 Test2 Test3 Test4 Test5 Average Grade%n");
// for each value in the gradeList arraylist, add the sorted student data (first name, last name, grade) to the info string variable with separated value.
for(int c = 0; c < 15; c++)
for(int s = 0; s < 5; s++)
I'm pretty sure I'm not even close but I am getting add errors in the add method.
0 · ·