Programming Basics C# Scholarship from Conditional Statements Exercise
Здравейте:)
Моля ви за помощ за задачата за стипендии. Вече я проверявам от доста време и не мога да си открия грешката. Judge ми дава 87 точки т.е. някъде имам потенциално две грешки, но не ги виждам.
Предварително благодаря:)
using System;
public class Program
{
public static void Main()
{
//Determine the variables to be entered by the user
double salaryParent=double.Parse(Console.ReadLine());
double mark=double.Parse(Console.ReadLine());
double minSalary=double.Parse(Console.ReadLine());
//Calculate the amount of socila and excellent scholarships
double excellentScholarshipCoefficient=25;
double socialScholarship=Math.Floor(0.35*minSalary);
double excellentScholarship=Math.Floor(mark*excellentScholarshipCoefficient);
if(salaryParent>minSalary&&mark<5.50)
{
Console.WriteLine("You cannot get a scholarship!");
}
else if(salaryParent<minSalary&&mark>=4.50&&mark<5.50)
{
Console.WriteLine($"You get a Social scholarship {socialScholarship} BGN");
}
else if(salaryParent>minSalary&&mark>=5.50)
{
Console.WriteLine($"You get a scholarship for excellent results {excellentScholarship} BGN");
}
else
{
if(socialScholarship>excellentScholarship)
{
Console.WriteLine($"You get a Social scholarship {socialScholarship} BGN");
}
else if(socialScholarship<excellentScholarship)
{
Console.WriteLine($"You get a scholarship for excellent results {excellentScholarship} BGN");
}
else
{
Console.WriteLine($"You get a scholarship for excellent results {excellentScholarship} BGN");
}
}
}
}
Благодаря за помощта.
Поздрави.
Дени
Моля, хубав ден!