06 Fruit Shop
Привет! Някой може ли да ми помогне да си поправя грешката. За плод различен от посочените не ми дава error.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Fruit_Shop
{
class Program
{
static void Main(string[] args)
{
string fruit = Console.ReadLine();
string day = Console.ReadLine();
double quantity = double.Parse(Console.ReadLine());
var price1 = new Dictionary<string, double>()
{
{ "banana", 2.50 },
{ "apple", 1.20 },
{ "orange", 0.85 },
{ "grapefruit", 1.45 },
{ "kiwi", 2.70 },
{ "pineapple", 5.50 },
{ "grapes", 3.85 }
};
var price2 = new Dictionary<string, double>()
{
{ "banana", 2.70 },
{ "apple", 1.25 },
{ "orange", 0.90 },
{ "grapefruit", 1.60 },
{ "kiwi", 3.00 },
{ "pineapple", 5.60 },
{ "grapes", 4.20 }
};
double result1 = quantity * price1[fruit];
double result2 = quantity * price2[fruit];
if (fruit == "banana" || fruit == "apple" || fruit == "orange" || fruit == "grapefruit" || fruit == "kiwi" || fruit == "pineaplle" || fruit == "grapes")
{
if (day == "Monday" || day == "Tuesday" || day == "Wednesday" || day == "Thursday" || day == "Friday") Console.WriteLine("{0:0.00}", result1);
else if (day == "Saturday" || day == "Sunday") Console.WriteLine("{0:0.00}", result2);
else Console.WriteLine("error");
}
else
{
Console.WriteLine("error");
}