Advertisement
desislavg

Untitled

May 12th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. using System;
  2.  
  3. namespace schoolEnd
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. string name = Console.ReadLine();
  10. int count = 0;
  11. double sum = 0.0;
  12. double average = 0.0;
  13.  
  14. while (true)
  15. {
  16. double num = double.Parse(Console.ReadLine());
  17. sum = sum + num;
  18. count++;
  19. if (count == 12)
  20.  
  21. {
  22. average = sum / count;
  23. if (average > 4 && average<= 6)
  24. {
  25.  
  26. Console.WriteLine($"{name} graduated. Average grade: {average:f2}");
  27. break;
  28. }
  29. else if ( average <4)
  30. {
  31. break;
  32. }
  33. }
  34. }
  35. }
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement