danail2003 4 Точки

## Scholarship

Здравейте, получавам 81/100 точки. Бихте ли ми казали къде ми е грешката?

using System;

namespace Scholarship
{
class Program
{
static void Main(string[] args)
{

double socialScholarship =Math.Floor(minSalary * 0.35);
double scholarshipForSuccess = Math.Floor(averageSuccess * 25);

if (income < minSalary && averageSuccess > 4.50 && socialScholarship > scholarshipForSuccess)
{
Console.WriteLine(\$"You get a Social scholarship {socialScholarship} BGN");
}
else if (averageSuccess >= 5.50 && scholarshipForSuccess >= socialScholarship)
{
Console.WriteLine(\$"You get a scholarship for excellent results {scholarshipForSuccess} BGN");
}
else
{
Console.WriteLine("You cannot get a scholarship!");
}
}

}
}

Тагове:
0
doani 21 Точки

Здравей, ето едно  решение , за да съпоставиш !

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Scholarship
{
class Program
{
static void Main(string[] args)
{

double amountSocial = minimalIncome * 0.35;
double amountExcellent = averageScore * 25;

if (income >= minimalIncome && averageScore < 5.50)
{
Console.WriteLine("You cannot get a scholarship!");
}
else if (income < minimalIncome && averageScore > 4.50 && averageScore < 5.50)
{
Console.WriteLine(\$"You get a Social scholarship {Math.Floor(amountSocial)} BGN");
}
else if (income < minimalIncome && averageScore >= 5.50)
{
if (amountExcellent < amountSocial)
{
Console.WriteLine(\$"You get a Social scholarship {Math.Floor(amountSocial)} BGN");
}
else if (amountExcellent >= amountSocial)
{
Console.WriteLine(\$"You get a scholarship for excellent results {Math.Floor(amountExcellent)} BGN");
}

}
else if (income >= minimalIncome && averageScore >= 5.50)
{
Console.WriteLine(\$"You get a scholarship for excellent results {Math.Floor(amountExcellent)} BGN");
}
else
{
Console.WriteLine("You cannot get a scholarship!");
}
}
}
}

0
danail2003 4 Точки

Благодаря!

0