Advertisement
kzborisov

Scholarship

Sep 17th, 2018
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 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 Scholarship
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. double incomeBGN = double.Parse(Console.ReadLine());
  14. double averageGrade = double.Parse(Console.ReadLine());
  15. double minimumSalary = double.Parse(Console.ReadLine());
  16. double socialScholarship = 0;
  17. double excellentResultScholarship = 0;
  18.  
  19. if (averageGrade >= 4.50 && minimumSalary > incomeBGN)
  20. {
  21. socialScholarship = minimumSalary * 0.35;
  22. }
  23. if (averageGrade >= 5.50)
  24. {
  25. excellentResultScholarship = averageGrade * 25;
  26. }
  27. if (socialScholarship != 0 || excellentResultScholarship != 0)
  28. {
  29. var result = Math.Max(socialScholarship, excellentResultScholarship);
  30. Console.WriteLine(result == socialScholarship ?
  31. "You get a Social scholarship {0} BGN" : "You get a scholarship for excellent results {1} BGN",
  32. (Math.Floor(socialScholarship)), (Math.Floor(excellentResultScholarship)));
  33. }
  34. else
  35. {
  36. Console.WriteLine($"You cannot get a scholarship!");
  37. }
  38. }
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement