fruit shop
Моля за помощ! Защо ми крашва кода?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FruitShop
{
class Program
{
static void Main(string[] args)
{
var fruit = Console.ReadLine().ToLower();
var day = Console.ReadLine().ToLower();
var quantity = double.Parse(Console.ReadLine());
var price = 0.0;
if (day == "saturday" || day == "sunday")
{
if (fruit == "banana")
{
price = 2.70;
}
else if (fruit == "apple")
{
price = 1.25;
}
else if (fruit == "orange")
{
price = 0.90;
}
else if (fruit == "grapefruit")
{
price = 1.60;
}
else if (fruit == "kiwi")
{
price = 3.0;
}
else if (fruit == "pineapple")
{
price = 5.60;
}
else if (fruit == "grapes")
{
price = 4.20;
}
}
else if (day == "monday" || day == "wednesday" || day == "thursday" || day == "friday" || day == "tuesday")
{
if (fruit == "banana")
{
price = 2.50;
}
else if (fruit == "apple")
{
price = 1.20;
}
else if (fruit == "orange")
{
price = 0.85;
}
else if (fruit == "grapefruit")
{
price = 1.45;
}
else if (fruit == "kiwi")
{
price = 2.7;
}
else if (fruit == "pineapple")
{
price = 5.50;
}
else if (fruit == "grapes")
{
price = 3.85;
}
}
if (price < 0.0)
{
Console.WriteLine("error");
}
else
{ Console.WriteLine(quantity*price); }
}
}
}