Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Train_The_Trainers
- {
- class Program
- {
- static void Main(string[] args)
- {
- int numberOfPeople = int.Parse(Console.ReadLine());
- string nameOfPresentation = Console.ReadLine();
- double totalGrades = 0;
- double totalCounter = 0;
- while (nameOfPresentation != "Finish")
- {
- double sumOfGrades = 0;
- double counter = 0;
- for (int i = 0; i < numberOfPeople; i++)
- {
- double grade = double.Parse(Console.ReadLine());
- sumOfGrades += grade;
- counter++;
- }
- Console.WriteLine($"{nameOfPresentation} - {sumOfGrades/counter:F2}.");
- nameOfPresentation = Console.ReadLine();
- totalGrades += sumOfGrades;
- totalCounter += counter;
- }
- if (nameOfPresentation == "Finish")
- {
- Console.WriteLine($"Student's final assessment is {totalGrades / totalCounter:F2}.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement