Does this seem like advanced Java, lol?
Still sitting in java class. I swear this is as procedural as it gets. I followed the instructions exactly.
package lab_04c;
/**
*
* @author visco
*/
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
System.out.println("Student Score Grade");
int[] scores = {76,91,80,55,71,98,70,88,69,60};
String[] names = {
"Suzie Q",
"Peggy Forsnacht",
"Boy George",
"Flea",
"Captain Hook",
"Nelson Mandela",
"he Might Thor",
"Oedipa Maas",
"Uncle Sam",
"The Tick"};
String[] grades = new String[scores.length];
System.out.println("Name Grade Score");
for(int x=0;x<scores.length;x++){
int score = scores[x];
String grade = "";
if(score < 60){
grade = "F";
} else if (score < 70){
grade = "D";
} else if (score < 80){
grade = "C";
} else if (score < 90){
grade = "B";
} else {
grade = "A";
}
grades[x] = grade;
System.out.println(names[x]+" "+score+" "+grade);
}
String[] possibleGrades = {"A", "B", "C", "D", "F"};
int[] frequency = {0,0,0,0,0};
double total=0;
Student: for(int student=0;student<scores.length;student++){
Grades: for(int g=0;g<possibleGrades.length;g++){
if(grades[student] == possibleGrades[g]){
frequency[g]++;
}
}
total += scores[student];
}
System.out.println("
Statistics:");
for(int g=0;g<possibleGrades.length;g++){
System.out.println("Total "+possibleGrades[g]+"s: "+frequency[g]);
}
System.out.println("
The mean score was : "+(total/scores.length));
}
}