Advertisement
Guest User

Untitled

a guest
Feb 19th, 2020
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Train_The_Trainers
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int numberOfPeople = int.Parse(Console.ReadLine());
  10. string nameOfPresentation = Console.ReadLine();
  11.  
  12. double totalGrades = 0;
  13. double totalCounter = 0;
  14.  
  15. while (nameOfPresentation != "Finish")
  16. {
  17. double sumOfGrades = 0;
  18. double counter = 0;
  19.  
  20. for (int i = 0; i < numberOfPeople; i++)
  21. {
  22. double grade = double.Parse(Console.ReadLine());
  23.  
  24. sumOfGrades += grade;
  25. counter++;
  26. }
  27. Console.WriteLine($"{nameOfPresentation} - {sumOfGrades/counter:F2}.");
  28.  
  29. nameOfPresentation = Console.ReadLine();
  30. totalGrades += sumOfGrades;
  31. totalCounter += counter;
  32. }
  33. if (nameOfPresentation == "Finish")
  34. {
  35. Console.WriteLine($"Student's final assessment is {totalGrades / totalCounter:F2}.");
  36. }
  37. }
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement