Question: I cannot figure out how to get this format out of my code. Here is what I have so far. It is BlueJ (JAVA) language.

 I cannot figure out how to get this format out of
I cannot figure out how to get this format out of my code. Here is what I have so far. It is BlueJ (JAVA) language. I need it to be exactly like the picture. Please and thanks.

import java.io.File;

import java.io.IOException;

import java.nio.charset.StandardCharsets;

import java.nio.file.Files;

import java.util.List;

public class Lab11 {

public static void main(String[] args)

{

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

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

System.out.println("** Lab 11 Spring 2018 **");

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

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

try

{

File file = new File("scores11.csv");

List lines = Files.readAllLines(file.toPath(),

StandardCharsets.UTF_8);

for (String line : lines) {

String[] scores = line.split(",");

double aveScore = aveScores(scores);

String grade = calcLetterGrade(aveScore);

printScores(scores, aveScore, grade);

}

}

catch(IOException ioe) {System.out.println(ioe);}

}

private static void printScores(String[] scores, double aveScore, String grade) {

System.out.println("Student # Scores Ave Grade");

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

for (int i = 0; i

System.out.print(scores[i] + " ");

}

System.out.println(" Average is :" + aveScore);

System.out.println("Grade is : " + grade);

System.out.println("");

}

private static double aveScores(String[] scores) {

double sum = 0;

for (int i = 0; i

sum += Integer.parseInt(scores[i]);

}

return sum / scores.length;

}

private static String calcLetterGrade(double score) {

int aveScore = (int)score;

if (aveScore >= 90 && aveScore

return "A";

} else if (aveScore >= 80 && aveScore

return "B";

} else if (aveScore >= 70 && aveScore

return "C";

} else if (aveScore >= 60 && aveScore

return "D";

} else if (aveScore

return "F";

} else {

return "";

}

}

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!