[Homework] Tech 4.0 C# - Intro and Basic Syntax - Задача 3 - Vacation
Здравейте! Получавам 91/100 на тази и наистина не мога да разбера причината. Някой намира ли пропуск?
using System;
namespace _03._Vacation
{
class Program
{
static void Main(string[] args)
{
int ppl = int.Parse(Console.ReadLine());
string type = Console.ReadLine().ToLower();
string day = Console.ReadLine().ToLower();
double price = 0;
if (type == "students")
{
switch (day)
{
case "friday": price = 8.45; break;
case "saturday": price = 9.80; break;
case "sunday": price = 10.46; break;
}
}
else if (type == "business")
{
switch (day)
{
case "friday": price = 10.90; break;
case "saturday": price = 15.60; break;
case "sunday": price = 16; break;
}
}
else if (type == "regular")
{
switch (day)
{
case "friday": price = 15; break;
case "saturday": price = 20; break;
case "sunday": price = 22.50; break;
}
}
double sum = ppl * price;
if (type == "students" && ppl >= 30) sum *= 0.85;
else if (type == "business" && ppl >= 100) ppl -= 10;
else if (type == "regular" && (10 <= ppl && ppl <= 20)) sum *= 0.95;
if (price != 0)
Console.WriteLine($"Total price: {sum:F2}");
}
}
}