Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package S6_NestedLoops;
- import java.util.Scanner;
- public class TrainTheTrainers {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int juryCount = Integer.parseInt(scanner.nextLine());
- int allGradesCount = 0;
- double sumAllGrades = 0.0;
- String command = scanner.nextLine();
- while (!command.equals("Finish")) {
- String presentationName = command;
- double sum = 0.0;
- for (int i = 1; i <= juryCount; i++) {
- double grade = Double.parseDouble(scanner.nextLine());
- sum += grade;
- sumAllGrades += grade;
- allGradesCount++;
- }
- System.out.printf("%s - %.2f.%n", presentationName, sum/juryCount);
- command = scanner.nextLine();
- }
- System.out.printf("Student's final assessment is %.2f.", sumAllGrades/allGradesCount);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement