Advertisement
dinko_dt

Untitled

Feb 29th, 2020
140
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. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. namespace BonusScoringSystem
  6. {
  7. class BonusScoringSystem
  8. {
  9. static void Main()
  10. {
  11. int countOfStudents = int.Parse(Console.ReadLine());
  12. int countOfLectures = int.Parse(Console.ReadLine());
  13. int initialBonus = int.Parse(Console.ReadLine());
  14. List<int> maxBonusPoints = new List<int>();
  15. var result = 0;
  16. double result1 = 0;
  17.  
  18.  
  19. for (int i = 0; i < countOfStudents; i++)
  20. {
  21. int studentAttendance = int.Parse(Console.ReadLine());
  22. maxBonusPoints.Add(studentAttendance);
  23. result = maxBonusPoints.Max();
  24. var firstPart = (double)result / countOfLectures;
  25. var secondPart = (5 + initialBonus);
  26.  
  27.  
  28. result1 = (int)Math.Ceiling((double)firstPart * secondPart);
  29.  
  30. }
  31.  
  32.  
  33. Console.WriteLine($"Max Bonus: {result1}.");
  34. Console.WriteLine($"The student has attended {result} lectures.");
  35.  
  36.  
  37. }
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement