Advertisement
Guest User

Scholarship

a guest
Jun 19th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.24 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp4
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double income = double.Parse(Console.ReadLine());
  10.             double evaluation = double.Parse(Console.ReadLine());
  11.             double minSalary = double.Parse(Console.ReadLine());
  12.  
  13.             double social = minSalary * 0.35;
  14.             double excellent = evaluation * 25;
  15.             double studentWillGet = 0.0;
  16.  
  17.             if (income < minSalary && evaluation > 4.50)
  18.             { studentWillGet = social;
  19.                 Console.WriteLine($"You get a social scholarship {studentWillGet} BGN");
  20.             }
  21.  
  22.             else if (evaluation >= 5.50)
  23.             { studentWillGet = excellent;
  24.                 Console.WriteLine($" You get a scholarship for excellent results {studentWillGet} BGN");
  25.             }
  26.  
  27.            
  28.             else if (social < minSalary && evaluation >= 5.5)
  29.             { studentWillGet = Math.Max(social, excellent); }
  30.             //else if (social == excellent)
  31.             //{ studentWillGet = excellent;
  32.             //    Console.WriteLine();
  33.             //}
  34.  
  35.             else
  36.                  Console.WriteLine("You can not get a scholarship!");
  37.  
  38.         }
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement