Advertisement
petrov_93

PB with C# If excercise (8. Scholarship) 100/100

Feb 19th, 2020
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _08_Scholarship
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. double income = double.Parse(Console.ReadLine());
  10. double avvGrades = double.Parse(Console.ReadLine());
  11. double minSalary = double.Parse(Console.ReadLine());
  12. double socialScholarship = Math.Floor(minSalary * 0.35);
  13. double gradeScholarship = Math.Floor(avvGrades * 25);
  14. if (income > minSalary && avvGrades < 5.50)
  15. {
  16. Console.WriteLine("You cannot get a scholarship!");
  17. }
  18. else if (minSalary >= income && avvGrades >= 4.50 && avvGrades < 5.50)
  19. {
  20. Console.WriteLine($"You get a Social scholarship {socialScholarship} BGN");
  21. }
  22. else if (minSalary >= income && avvGrades >= 5.50)
  23. {
  24. if (socialScholarship > gradeScholarship)
  25. {
  26. Console.WriteLine($"You get a Social scholarship {socialScholarship} BGN");
  27. }
  28. else
  29. {
  30. Console.WriteLine($"You get a scholarship for excellent results {gradeScholarship} BGN");
  31. }
  32. }
  33. else if (avvGrades >= 5.50)
  34. {
  35. Console.WriteLine($"You get a scholarship for excellent results {gradeScholarship} BGN");
  36. }
  37. else if (income < minSalary && avvGrades < 4.50)
  38. {
  39. Console.WriteLine("You cannot get a scholarship!");
  40. }
  41.  
  42.  
  43.  
  44. }
  45. }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement