Advertisement
Yanislav29

Untitled

Nov 21st, 2019
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Equal_Sums_Left_Right_Position
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int jury = int.Parse(Console.ReadLine());
  10. string command = Console.ReadLine();
  11. double sumofAllP = 0;
  12. int cnt = 0;
  13. while(command != "Finsih")
  14. {
  15.  
  16. double sumGradesforP = 0;
  17. for(int i = 1;i <= jury; i++)
  18. {
  19. double grade = double.Parse(Console.ReadLine());
  20. cnt++;
  21. sumGradesforP += grade;
  22. sumofAllP += grade;
  23. }
  24. double avgforP = sumGradesforP / jury;
  25. Console.WriteLine($"{command} - {avgforP:f2}");
  26.  
  27. command = Console.ReadLine();
  28.  
  29.  
  30.  
  31. }
  32.  
  33. double arerageforAllP = sumofAllP / cnt;
  34. if (command == "Finish")
  35. {
  36. Console.WriteLine($"Student's final assessment is { arerageforAllP:F2}");
  37. }
  38. }
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement