Advertisement
IvetValcheva

04. Train The Trainers

Feb 13th, 2022
357
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _04._Train_The_Trainers
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int n = int.Parse(Console.ReadLine()); //броя на журито
  10.  
  11. string input = Console.ReadLine();
  12.  
  13. double presentationEv; //сборът на всички оценки на моментната презентация
  14.  
  15. int presentationNum=0; //броя на всички презентации;
  16. double evaluation = 0; //сбор от средните оценки за всяка от презентациите
  17.  
  18. //четем имена презентации и ги оценяваме, докато не получим input = "finish"
  19. while (input != "Finish")
  20. {
  21. //=>input => име на презентация
  22.  
  23. presentationEv = 0;// нулираме сборът от оценките на всеки оценяващ
  24.  
  25. for (int i = 1; i <=n; i++)
  26. {
  27. //=> всеки ще даде оценка => ще се добавя към personalEvaluation
  28. presentationEv += double.Parse(Console.ReadLine());
  29. }
  30.  
  31. //намираме средна оценка =>
  32. presentationEv = presentationEv / n;
  33.  
  34. // трябва да я добавим към сбора на всички средни оценки=>
  35. evaluation += presentationEv;
  36.  
  37. Console.WriteLine($"{input} - {presentationEv:f2}.");
  38.  
  39. presentationNum++;
  40.  
  41. //четем нов вход (input)
  42. input = Console.ReadLine();
  43. }
  44.  
  45. Console.WriteLine($"Student's final assessment is {evaluation/presentationNum:f2}.");
  46. }
  47. }
  48. }
  49.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement