Advertisement
Guest User

Untitled

a guest
Sep 15th, 2019
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Scholarship
  4. {
  5. class Program
  6. {
  7. static void Main()
  8. {
  9. double income = double.Parse(Console.ReadLine());
  10. double average = double.Parse(Console.ReadLine());
  11. double minimalSalary = double.Parse(Console.ReadLine());
  12. double socialScholarship = 0;
  13. double excellenceScholarship = 0;
  14. bool excellence = false;
  15. bool social = false;
  16.  
  17. if (income < minimalSalary && average > 4.5)
  18. {
  19. socialScholarship = minimalSalary * 0.35;
  20. }
  21. else if (average >= 5.5)
  22. {
  23. excellenceScholarship = average * 25;
  24. }
  25.  
  26. if (socialScholarship > 0 || excellenceScholarship > 0)
  27. {
  28. if (excellenceScholarship >= socialScholarship)
  29. {
  30. excellence = true;
  31. }
  32. else if (excellenceScholarship < socialScholarship)
  33. {
  34. social = true;
  35. }
  36. else if (excellenceScholarship == socialScholarship)
  37. {
  38. excellence = true;
  39. }
  40. else if (socialScholarship > 0 && excellenceScholarship == 0)
  41. {
  42. social = true;
  43. }
  44. else if (socialScholarship == 0 && excellenceScholarship > 0)
  45. {
  46. excellence = true;
  47. }
  48. }
  49.  
  50. if (excellence)
  51. {
  52. Console.WriteLine($"You get a scholarship for excellent results {Math.Floor(excellenceScholarship)} BGN");
  53. }
  54. else if (social)
  55. {
  56. Console.WriteLine($"You get a Social scholarship {Math.Floor(socialScholarship)} BGN");
  57. }
  58. else
  59. {
  60. Console.WriteLine("You cannot get a scholarship!");
  61. }
  62. }
  63. }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement