Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Scholarships
- {
- class Program
- {
- static void Main(string[] args)
- {
- double income = double.Parse(Console.ReadLine());
- double grade = double.Parse(Console.ReadLine());
- double minSalary = double.Parse(Console.ReadLine());
- double minScoreSocial = 4.5;
- double minScoreGrade = 5.5;
- double gradeOdd = 25.0;
- double socialScholarshipFormula;
- double gradeScholarshipFormula;
- bool socialScholarship = (income < minSalary && grade >= minScoreSocial);
- bool gradeScholarship = (grade >= minScoreGrade);
- bool cantGetBoth = (!socialScholarship && !gradeScholarship);
- if (socialScholarship)
- {
- socialScholarshipFormula = Math.Floor(minSalary * 0.35);
- }
- else
- {
- socialScholarshipFormula = 0;
- }
- if (gradeScholarship)
- {
- gradeScholarshipFormula = Math.Floor(grade * gradeOdd);
- }
- else
- {
- gradeScholarshipFormula = 0;
- }
- if (cantGetBoth)
- {
- Console.WriteLine("You cannot get a scholarship!");
- }
- else if (socialScholarshipFormula > gradeScholarshipFormula)
- {
- Console.WriteLine($"You get a Social scholarship {socialScholarshipFormula} BGN");
- }
- else
- {
- Console.WriteLine($"You get a scholarship for excellent results {gradeScholarshipFormula} BGN");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement