Advertisement
svephoto

Scholarship [C#]

Feb 23rd, 2020
412
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.18 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Scholarship
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double income = double.Parse(Console.ReadLine());
  10.             double grades = double.Parse(Console.ReadLine());
  11.             double minimalIncome = double.Parse(Console.ReadLine());
  12.  
  13.             double socialPrice = Math.Floor(minimalIncome * 0.35);
  14.             double excellentPrice = Math.Floor(grades * 25);
  15.  
  16.             if (grades >= 5.5)
  17.             {
  18.                 if (excellentPrice >= socialPrice || income > minimalIncome)
  19.                 {
  20.                     Console.WriteLine($"You get a scholarship for excellent results {excellentPrice} BGN");
  21.                 }
  22.                 else
  23.                 {
  24.                     Console.WriteLine($"You get a Social scholarship {socialPrice} BGN");
  25.                 }
  26.             }
  27.             else if (grades > 4.5 && income < minimalIncome)
  28.             {
  29.                 Console.WriteLine($"You get a Social scholarship {socialPrice} BGN");
  30.             }
  31.             else
  32.             {
  33.                 Console.WriteLine("You cannot get a scholarship!");
  34.             }
  35.         }
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement