Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Program
- {
- public static void Main()
- {
- int n = int.Parse(Console.ReadLine()); // num of people in the jury
- int countOfPresentations = 0;
- double totalSumOfGrades = 0;
- string presentation = Console.ReadLine();
- while (presentation != "Finish")
- {
- countOfPresentations++;
- double sumOfGrades = 0;
- // for loop for the grades:
- for (int i = 0; i < n; i++)
- {
- double grade = double.Parse(Console.ReadLine());
- sumOfGrades += grade;
- }
- double averageGrade = sumOfGrades / n;
- Console.WriteLine($"{presentation} - {averageGrade:f2}.");
- totalSumOfGrades += averageGrade;
- presentation = Console.ReadLine();
- }
- Console.WriteLine($"Student's final assessment is {totalSumOfGrades/countOfPresentations:f2}.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement