Advertisement
Guest User

Scholarship

a guest
Oct 23rd, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.81 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 Practice2
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double income = double.Parse(Console.ReadLine());
  14.             double grade = double.Parse(Console.ReadLine());
  15.             double minSal = double.Parse(Console.ReadLine());
  16.             if (income >= minSal)
  17.             {
  18.                 if (grade < 5.50)
  19.                 {
  20.                     Console.WriteLine("You cannot get a scholarship!");
  21.                 }
  22.                 else
  23.                 {
  24.                     double scholarship = grade * 25;
  25.                     Console.WriteLine($"You get a scholarship for excellent results {Math.Floor(scholarship)} BGN");
  26.                 }
  27.             }
  28.             else if (income < minSal)
  29.             {
  30.                 if (grade >= 5.50)
  31.                 {
  32.                     double scholarship1 = minSal * 0.35;
  33.                     double scholarship2 = grade * 25;
  34.                     if (scholarship1 > scholarship2)
  35.                     {
  36.                         Console.WriteLine($"You get a Social scholarship {Math.Floor(scholarship1)} BGN");
  37.                     }
  38.                     else { Console.WriteLine($"You get a scholarship for excellent results {Math.Floor(scholarship2)} BGN"); }
  39.                 }
  40.                 else if (grade > 4.50 && grade < 5.50)
  41.                 {
  42.                     double scholarship = minSal * 0.35;
  43.                     Console.WriteLine($"You get a Social scholarship {Math.Floor(scholarship)} BGN");
  44.                 }
  45.                 else
  46.                 {
  47.                     Console.WriteLine("You cannot get a scholarship!");
  48.                 }
  49.             }
  50.         }
  51.     }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement