I need help with this program
I need to be able to type all the names and the grades then the graph of all the student will be shown but i am only able to type one student name and grade and the graph shows but i can still type student....
am i doing the for looping wrong?
import java.util.Scanner;
public class Students {
public static void main (final String[] args) {
final Scanner scanner = new Scanner (System.in);
final String name = "Name";
final String result = "Grade";
final String letter = "Letter";
// String s1 = scanner.next ();
// if (scanner.hasNextDouble ()) {
for (int i = 0; i < 4; i++) {
final String s3 = scanner.next ();
final String s2 = scanner.next ();
final int score = scanner.nextInt ();
char grade = 0; // "blank final"
if (score >= 90) {
grade = 'A';
} else if (score >= 80) {
grade = 'B';
} else if (score >= 70) {
grade = 'C';
} else if (score >= 60) {
grade = 'D';
} else {
grade = 'F';
}
System.out.printf (" %-10s %5s %10s%n ", name, result, letter);
System.out.printf ("%-10s %-9d %-10s", s3 + s2, score, grade);
System.out.println ();
}
}
}