8. Завършване - част 2
Колеги, моля за помощ за задача 8. Нещо не мога да хвана къде бъркам.
import java.util.Scanner; public class GraduationPartTwo { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String studentName = scanner.nextLine(); double sum = 0; int count = 0; boolean end = false; while (count < 12) { double grade = Double.parseDouble(scanner.nextLine()); if (grade > 4) { sum = sum + grade; count++; end = true; } else { grade = Double.parseDouble(scanner.nextLine()); count++; break; } } if (end) { System.out.printf("%s graduated. Average grade: %.2f", studentName, sum / 12); } else { System.out.printf("%s has been excluded at %d grade", studentName, count); } } }