Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2019
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 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 train_the_trainers
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int numberOfPeople = int.Parse(Console.ReadLine());
  14. double allScore = 0;
  15. double counter = 0;
  16.  
  17. while (true)
  18. {
  19. string nameOfPresentation = Console.ReadLine();
  20. double sumOfGrades = 0;
  21.  
  22. if (nameOfPresentation=="Finish")
  23. {
  24. double scoreSum=allScore/counter;
  25. Console.WriteLine($"Student's final assessment is {scoreSum:f2}.");
  26. break;
  27. }
  28. for (int i = 0; i < numberOfPeople; i++)
  29. {
  30. double grade = double.Parse(Console.ReadLine());
  31. sumOfGrades += grade;
  32. allScore += grade;
  33. counter++;
  34. }
  35. double sumAfter = sumOfGrades / numberOfPeople;
  36. Console.WriteLine($"{nameOfPresentation} - {sumAfter:f2}.");
  37.  
  38. }
  39. }
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement