Advertisement
countDecko

scholarship

Jan 27th, 2019
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.34 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 income = double.Parse(Console.ReadLine());
  14.             double gradeAvg = double.Parse(Console.ReadLine());
  15.             double minSalary = double.Parse(Console.ReadLine());
  16.             double socScholarship = 0;
  17.             double gradeScholarship = 0;
  18.  
  19.             if (income < minSalary && gradeAvg > 4.5)
  20.             {
  21.                 socScholarship = 0.35 * minSalary;
  22.             }
  23.             if (gradeAvg >= 5.5)
  24.             {
  25.                 gradeScholarship = gradeAvg * 25;
  26.             }
  27.  
  28.             if (socScholarship != 0 || gradeScholarship != 0)
  29.             {
  30.                 if(gradeScholarship >= socScholarship)
  31.                 {
  32.                     Console.WriteLine($"You get a scholarship for excellent results {Math.Floor(gradeScholarship)} BGN");
  33.                 }
  34.                 else
  35.                 {
  36.                     Console.WriteLine($"You get a Social scholarship {Math.Floor(socScholarship)} BGN");
  37.                 }
  38.             }
  39.             else
  40.             {
  41.                 Console.WriteLine("You cannot get a scholarship!");
  42.             }
  43.         }
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement