More Exercises Conditional 08. Fuel Tank - Part 2
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace FuelTankPart2
{
class Program
{
static void Main(string[] args)
{
string fuel = Console.ReadLine();
double fuelLitres = double.Parse(Console.ReadLine());
string discountCard = Console.ReadLine();
double cost = 0;
if (fuel == "Gas")
{
cost = cost + 0.93 * fuelLitres;
if (discountCard == "Yes")
{
cost -= 0.08 * fuelLitres;
}
}
else if (fuel == "Gasoline")
{
cost = cost + 2.22 * fuelLitres;
if (discountCard == "Yes")
{
cost -= 0.12 * fuelLitres;
}
}
else if (fuel == "Diesel")
{
cost = cost + 2.33 * fuelLitres;
if (discountCard == "Yes")
{
cost -= 0.18 * fuelLitres;
}
}
if (20<=fuelLitres && fuelLitres<=25)
{
cost = cost - cost * 0.08;
}
else if (fuelLitres>25)
{
cost = cost - cost * 0.1;
}
Console.WriteLine($"{cost:f2} lv.");
}
}
}
Дава ми 63/100 не разбирам грешката си моля за помощ <3.