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