Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class demo {
- public static void main(String[] args) {
- Scanner scanner = new Scanner (System.in);
- int countJury = Integer.parseInt(scanner.nextLine());
- String command = scanner.nextLine();
- //Finish Или име на презентация
- double sumAllGrades = 0; //сумата от оценките за всички презентации
- int countAllGrades = 0; //броят на всички оценки
- while(!command.equals("Finish")) {
- //име на презентация
- String presentation = command;
- double sumGradePerPresentation = 0;
- for (int jury = 1; jury <= countJury ; jury++) {
- double grade = Double.parseDouble(scanner.nextLine());
- countAllGrades++;
- sumGradePerPresentation += grade;
- sumAllGrades += grade;
- }
- double averageGrade = sumGradePerPresentation / countJury;
- System.out.printf("%s - %.2f.%n", presentation, averageGrade);
- command = scanner.nextLine();
- }
- double averageAll = sumAllGrades / countAllGrades;
- System.out.printf("Student's final assessment is %.2f.", averageAll);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment