Advertisement
Valantina

TrainTheTrainers

Jun 9th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.39 KB | None | 0 0
  1. using System;
  2.  
  3. namespace TrainTheTrainers
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int juryMembers = int.Parse(Console.ReadLine());
  10.             string presentationName = Console.ReadLine();
  11.             string currentPresentation = string.Empty;
  12.             double grade = 0;
  13.             double avgGrade = 0;
  14.             double allPresentationScore = 0;
  15.             int scoreCounter = 0;
  16.             double result = 0;
  17.             while (true)
  18.             {
  19.                 if (presentationName == "Finish")
  20.                 {
  21.                     Console.WriteLine($"Student's final assessment is {result / scoreCounter:f2}.");
  22.                     break;
  23.                 }
  24.                 for (int i = 0; i < juryMembers; i++)
  25.                 {
  26.                     grade = double.Parse(Console.ReadLine());
  27.                     avgGrade += grade;
  28.                 }
  29.                 currentPresentation = presentationName;
  30.                 allPresentationScore += avgGrade / juryMembers;
  31.                 result += allPresentationScore;
  32.                 Console.WriteLine($"{currentPresentation} - {allPresentationScore:f2}.");
  33.                 allPresentationScore = 0;
  34.                 avgGrade = 0;
  35.                 grade = 0;
  36.                 scoreCounter++;
  37.                 presentationName = Console.ReadLine();
  38.             }
  39.         }
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement