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