Искам съвет как да :F# отговора. Задaча 11. Fruit Shop от Conditional Statements Advanced - Lab
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication3
{
class Program
{
static void Main(string[] args)
{
string fruit = Console.ReadLine();
string day = Console.ReadLine();
double num = double.Parse(Console.ReadLine());
if ((day == "Monday") || (day == "Tuesday") || (day == "Wednesday") || (day == "Thursday") || (day == "Friday"))
{
switch (fruit)
{
case "banana": Console.WriteLine(num * 2.5); break;
case "apple": Console.WriteLine(num * 1.2); break;
case "orange": Console.WriteLine(num * 0.85); break;
case "grapefruit": Console.WriteLine(num * 1.45); break;
case "kiwi": Console.WriteLine(num * 2.70); break;
case "pineapple": Console.WriteLine(num * 5.5); break;
case "grapes": Console.WriteLine(num * 3.85); break;
default: Console.WriteLine("error"); break;
}
}
else if ((day == "Saturday")||(day == "Sunday"))
{
switch (fruit)
{
case "banana": Console.WriteLine(num * 2.7); break;
case "apple": Console.WriteLine(num * 1.25); break;
case "orange": Console.WriteLine(num * 0.90); break;
case "grapefruit": Console.WriteLine(num * 1.60); break;
case "kiwi": Console.WriteLine(num * 3.00); break;
case "pineapple": Console.WriteLine(num * 5.60); break;
case "grapes": Console.WriteLine(num * 4.20); break;
default: Console.WriteLine("error"); break;
}
}
else {Console.WriteLine("error");}
}
}
}