My project begins with me importing data from a text file and converting it into an ArrayList. I'm not very familiar with ArrayLists and I don't quite know how this will work. I've provided the starter file my instructor has provided and it looks like I'll need to use a buffered reader to import the text file. Because this course has a habit of provided starter code without a good explanation of what that code does I would also appreciate a simple explanation of what a bufferedreader is and how I would create one myself if I had too. Here is the text file as it appears when opened:
manny 89 78 100 91 67
cindy 66 81 94 80 71
timmy 85 59 100 83 21
mikey 88 76 69 82 90
kelly 68 93 63 92 55
sandy 80 73 67 51 99
Here is the starter code:
import java.util.*;
import java.io.*;
public class ExamScores
{
public static void main( String args[] ) throws Exception
{
// close/reuse this file handle on the next file
BufferedReader infile = new BufferedReader( new FileReader( "ExamScores.txt" ) );
// you declare all needed ArrayLists and other variables from here on.
System.out.println("\nSTEP #1: 50%"); // 50%
System.out.println("\nSTEP #2: 25%"); // 75 %
System.out.println("\nSTEP #3: 10%"); // 85%
System.out.println("\nSTEP #4: 15%"); // 100%
} // END MAIN
// - - - - - - H E L P E R M E T H O D S H E R E - - - - -
} // END EXAMSCORES CLASS
Once I've created an ArrayList how do I go about manipulating it to do things like sort the names into alphabetical order. Is an ArrayList a lot like a two dimensional array or is each row in that text file going to be a separate array list? To create an idea of everything I need to do in this project I have to sort the names by alphabetical order in an array list. Then I need to compute the average score of each name and finally I need to take the average of the first, third, and fifth exams for each student and find out which of those three exams they scored the lowest average on? I'm not pandering for the exact answer to the project but I want to provide all information for what I'm expected to be able to do with an arraylist at this point. Thank you.