I'm struggling with my program and I'm looking for some help. I'm supposed to be able to output a table with my student names, all my exam grades, quiz grades, homework grades, and the final averaged grade. I'm having quite a bit of difficulty figuring out how to use System.out.printf to format my table correctly. Right now I'm having the problem where I do not understand how to loop my arrays so they continually print out up to 200 student's names and grades. 

I tried to lay it out by doing 3 separate student's grades, but I'm having the problem where it says all my exam, quiz, and hw arrays cannot be resolved to a variable. This confuses me because I've already changed them from a string into a double. If it helps here is the code I used to try and switch my inputs to doubles.

```
// declare Double[] exams using length numExams
                    Double[] exams = new Double[numExams];
                    // iterates through Array exams and adds values from allInfo
                    for (int k = 0; k < exams.length; k++) {
                        exams[k] = Double.parseDouble(allInfo.get(1 + k)
                                .substring(1));

                        // prints out (delete this when you finish program)
                        //System.out.print(exams[k] + "\t");
                    }

                    //System.out.println(" ");

                    // declare Double[] quizzes using length numQuizzes
                    Double[] quizzes = new Double[numQuizzes];
                    // iterates through Array quizzes and adds values from
                    // allInfo
                    for (int k = 0; k < quizzes.length; k++) {
                        quizzes[k] = Double.parseDouble(allInfo.get(
                                1 + numExams + k).substring(1));

                        // prints out (delete this when you finish program)
                        //System.out.print(quizzes[k] + "\t");
                    }

                    //System.out.println(" ");

                    // declare Double[] HW using length numHW
                    Double[] hw = new Double[numHW];
                    // iterates through Array hw and adds values from allInfo
                    for (int k = 0; k < hw.length; k++) {
                        hw[k] = Double.parseDouble(allInfo.get(
                                1 + numExams + numQuizzes + k).substring(1));

```

Hopefully that helps you understand my train of thought. Here is the code that I laid out and tried to figure out as well.

```
if (choice == 2) {
            System.out.println("Display student grades & statistics");

            //Formatting for the heading of my grade table
            System.out.printf("%-10s","Name");
            System.out.printf("%-5s","Exam");
            System.out.printf("%-5s","Exam");
            System.out.printf("%-5s","Exam");
            System.out.printf("%-5s","Quiz");
            System.out.printf("%-5s","Quiz");
            System.out.printf("%-5s","Quiz");
            System.out.printf("%-7s","HWork");
            System.out.printf("%-7s","HWork");
            System.out.printf("%-7s","HWork");
            System.out.printf("%-5s","Grade\n");

            System.out.printf("%-10s",studentNames[0]);
            System.out.printf("%-5.1f",exams[0]);
            System.out.printf("%-5.1f",exams[1]);
            System.out.printf("%-5.1f",exams[2]);
            System.out.printf("%-5.1f",quizzes[0]);
            System.out.printf("%-5.1f",quizzes[1]);
            System.out.printf("%-5.1f",quizzes[2]);
            System.out.printf("%-7.1f",hw[0]);
            System.out.printf("%-7.1f",hw[1]);
            System.out.printf("%-7.1f",hw[2]);
            System.out.printf("%-5.1f",gradeAverage[0] + "\n");

            System.out.printf("%-10s",studentNames[1]);
            System.out.printf("%-5.1f",exams[3]);
            System.out.printf("%-5.1f",exams[4]);
            System.out.printf("%-5.1f",exams[5]);
            System.out.printf("%-5.1f",quizzes[3]);
            System.out.printf("%-5.1f",quizzes[4]);
            System.out.printf("%-5.1f",quizzes[5]);
            System.out.printf("%-7.1f",hw[3]);
            System.out.printf("%-7.1f",hw[4]);
            System.out.printf("%-7.1f",hw[5]);
            System.out.printf("%-5.1f",gradeAverage[1] + "\n");

            System.out.printf("%-10s",studentNames[2]);
            System.out.printf("%-5.1f",exams[6]);
            System.out.printf("%-5.1f",exams[7]);
            System.out.printf("%-5.1f",exams[8]);
            System.out.printf("%-5.1f",quizzes[6]);
            System.out.printf("%-5.1f",quizzes[7]);
            System.out.printf("%-5.1f",quizzes[8]);
            System.out.printf("%-7.1f",hw[6]);
            System.out.printf("%-7.1f",hw[7]);
            System.out.printf("%-7.1f",hw[8]);
            System.out.printf("%-5.1f",gradeAverage[2] + "\n");

                }

```