Advertisement
bullit3189

Train the trainers

Nov 1st, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. using System;
  2.  
  3. public class Program
  4. {
  5. public static void Main()
  6. {
  7. int n = int.Parse(Console.ReadLine());
  8. string name = Console.ReadLine();
  9.  
  10.  
  11. double gradesSum =0;
  12. double presentationSum =0;
  13. int counterPresentations =0;
  14.  
  15. while (name!= "Finish")
  16. {
  17. for (int i=1; i<=n; i++)
  18. {
  19. double grade = double.Parse(Console.ReadLine());
  20.  
  21. gradesSum += grade;
  22.  
  23.  
  24. }
  25. presentationSum += gradesSum;
  26. Console.WriteLine("{0} - {1:f2}.",name,gradesSum/n);
  27. gradesSum =0;
  28. counterPresentations++;
  29. name=Console.ReadLine();
  30. }
  31. Console.WriteLine("Student's final assessment is {0:f2}.",presentationSum/(counterPresentations*n));
  32.  
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement