Advertisement
dragonbs

TrainTheTrainers

Jan 25th, 2023
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.20 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _04.TrainTheTrainers
  4. {
  5.     internal class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int peopleInJury = int.Parse(Console.ReadLine());
  10.             string nameOfPresentation = Console.ReadLine();
  11.  
  12.             double averageScoreForAllPresentation = 0;
  13.             int counter = 0;
  14.  
  15.             while (nameOfPresentation != "Finish")
  16.             {
  17.                 double averageScore = 0;
  18.  
  19.                 for (int i = 0; i < peopleInJury; i++)
  20.                 {
  21.                     double currentScore = double.Parse(Console.ReadLine());
  22.  
  23.                     averageScore += currentScore;
  24.                     averageScoreForAllPresentation += currentScore;
  25.                     counter++;
  26.                 }
  27.  
  28.                 double averageScorePerPresentation = averageScore / peopleInJury;
  29.  
  30.                 Console.WriteLine($"{nameOfPresentation} - {averageScorePerPresentation:F2}.");
  31.  
  32.                 nameOfPresentation = Console.ReadLine();
  33.             }
  34.  
  35.             double assesment = averageScoreForAllPresentation / counter;
  36.  
  37.             Console.WriteLine($"Student's final assessment is {assesment:F2}.");
  38.         }
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement