Advertisement
Spocoman

04. Train The Trainers

Aug 30th, 2024
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.86 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class TrainTheTrainers {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         int juryCount = Integer.parseInt(scanner.nextLine()),
  7.                 counter = 0;
  8.         double totalScores = 0;
  9.  
  10.         String presentation = "";
  11.         while (!(presentation = scanner.nextLine()).equals("Finish")) {
  12.             double score, sumScores = 0;
  13.             for (int i = 0; i < juryCount; i++) {
  14.                 score = Double.parseDouble(scanner.nextLine());
  15.                 sumScores += score;
  16.             }
  17.  
  18.             System.out.printf("%s - %.2f.\n", presentation, sumScores / juryCount);
  19.             totalScores += sumScores;
  20.             counter++;
  21.         }
  22.  
  23.         System.out.printf("Student's final assessment is %.2f.\n", totalScores / (counter * juryCount));
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement