Conditional Statements - Exercise (7.Shopping) https://judge.softuni.org/Contests/2376/Conditional-Statements-Exercise
double butget = double.Parse(Console.ReadLine());
int videokarti = int.Parse(Console.ReadLine());
int procesor = int.Parse(Console.ReadLine());
int pamet = int.Parse(Console.ReadLine());
int videokartiCena = 250 * videokarti;
double procesorCena = videokartiCena * 0.35 * procesor;
double pametCena = videokartiCena * 0.1 * pamet;
double sum = 0.0;
double otstypka = 0.0;
if (videokarti > procesor)
{
sum = videokartiCena + procesorCena + pametCena;
otstypka = sum * 0.15;
sum = sum - otstypka;
}
else
{
sum = videokartiCena + procesorCena + pametCena;
}
if (butget > sum)
{
Console.WriteLine($"You have {butget - sum:f2} leva left!");
}
else
{
Console.WriteLine($"Not enough money! You need {sum - butget:f2} leva more!");
}