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