Advertisement
Guest User

trainers

a guest
Oct 28th, 2018
801
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.29 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace trainTheTrainers
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.            int judges = int.Parse(Console.ReadLine());
  14.             decimal allPresentationScore = 0.00M;
  15.             decimal scoreCounter = 0M;
  16.             while (true)
  17.             {
  18.                 string presentation = Console.ReadLine();
  19.                 decimal presentationScore = 0.00M;
  20.                 if (presentation == "Finish")
  21.                 {
  22.                     decimal scoreSum = allPresentationScore / scoreCounter;
  23.                     Console.WriteLine($"Student's final assessment is {scoreSum:F2}.");
  24.                     break;
  25.                 }
  26.                 for (int i = 0; i < judges; i++)
  27.                 {
  28.                     decimal score = decimal.Parse(Console.ReadLine());
  29.                     presentationScore += score;
  30.                     allPresentationScore += score;
  31.                     scoreCounter++;
  32.                 }
  33.                 decimal presentationSingleScore = presentationScore / judges;
  34.                 Console.WriteLine($"{presentation} - {presentationSingleScore:F2}.");
  35.             }
  36.            
  37.         }
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement