Guest User

Untitled

a guest
Feb 14th, 2019
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.83 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 _07_Scholarship
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double income = double.Parse(Console.ReadLine());
  14.             double success = double.Parse(Console.ReadLine());
  15.             double minSalary = double.Parse(Console.ReadLine());
  16.  
  17.             double socialScholarship = 0.35 * minSalary;
  18.             double successScholarship = success * 25;
  19.  
  20.             if (success < 4.50)
  21.                 Console.WriteLine("You cannot get a scholarship!");
  22.  
  23.             else if (success == 4.50)
  24.                 Console.WriteLine("You cannot get a scholarship!");
  25.                
  26.             else if (success > 4.50)
  27.             {
  28.                 if (income >= minSalary && success < 5.50)
  29.                     Console.WriteLine("You cannot get a scholarship!");
  30.                 else if (income >= minSalary && success >= 5.50)
  31.                     Console.WriteLine($"You get a scholarship for excellent results {Math.Truncate(successScholarship)} BGN");
  32.                 else if (income < minSalary && success < 5.50)
  33.                     Console.WriteLine($"You get a Social scholarship {Math.Truncate(socialScholarship)} BGN");
  34.                 else if (income < minSalary && success >= 5.50)
  35.                 {
  36.                     if (socialScholarship > successScholarship)
  37.                         Console.WriteLine($"You get a Social scholarship {Math.Truncate(socialScholarship)} BGN");
  38.                     else if (successScholarship >= socialScholarship)
  39.                         Console.WriteLine($"You get a scholarship for excellent results {Math.Truncate(successScholarship)} BGN");
  40.                 }
  41.             }                      
  42.         }
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment