Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _11._Fruit_Shop
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- string fruit = Console.ReadLine();
- //pochvam s denq
- string day = Console.ReadLine();
- double quantity = double.Parse(Console.ReadLine());
- double fruitPrice = 0;
- switch (day)
- {
- case "Monday":
- switch (fruit)
- {
- case "banana":
- fruitPrice = quantity * 2.50;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "apple":
- fruitPrice = quantity * 1.20;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "orange":
- fruitPrice = quantity * 0.85;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "grapefruit":
- fruitPrice = quantity * 1.45;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "kiwi":
- fruitPrice = quantity * 2.70;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "pineapple":
- fruitPrice = quantity * 5.50;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "grapes":
- fruitPrice = quantity * 3.85;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- default:
- Console.WriteLine("error");
- break;
- }
- break;
- case "Tuesday":
- switch (fruit)
- {
- case "banana":
- fruitPrice = quantity * 2.50;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "apple":
- fruitPrice = quantity * 1.20;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "orange":
- fruitPrice = quantity * 0.85;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "grapefruit":
- fruitPrice = quantity * 1.45;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "kiwi":
- fruitPrice = quantity * 2.70;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "pineapple":
- fruitPrice = quantity * 5.50;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "grapes":
- fruitPrice = quantity * 3.85;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- default:
- Console.WriteLine("error");
- break;
- }
- break;
- case "Wednesday":
- switch (fruit)
- {
- case "banana":
- fruitPrice = quantity * 2.50;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "apple":
- fruitPrice = quantity * 1.20;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "orange":
- fruitPrice = quantity * 0.85;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "grapefruit":
- fruitPrice = quantity * 1.45;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "kiwi":
- fruitPrice = quantity * 2.70;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "pineapple":
- fruitPrice = quantity * 5.50;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "grapes":
- fruitPrice = quantity * 3.85;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- default:
- Console.WriteLine("error");
- break;
- }
- break;
- case "Thursday":
- switch (fruit)
- {
- case "banana":
- fruitPrice = quantity * 2.50;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "apple":
- fruitPrice = quantity * 1.20;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "orange":
- fruitPrice = quantity * 0.85;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "grapefruit":
- fruitPrice = quantity * 1.45;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "kiwi":
- fruitPrice = quantity * 2.70;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "pineapple":
- fruitPrice = quantity * 5.50;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "grapes":
- fruitPrice = quantity * 3.85;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- default:
- Console.WriteLine("error");
- break;
- }
- break;
- case "Friday":
- switch (fruit)
- {
- case "banana":
- fruitPrice = quantity * 2.50;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "apple":
- fruitPrice = quantity * 1.20;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "orange":
- fruitPrice = quantity * 0.85;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "grapefruit":
- fruitPrice = quantity * 1.45;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "kiwi":
- fruitPrice = quantity * 2.70;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "pineapple":
- fruitPrice = quantity * 5.50;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "grapes":
- fruitPrice = quantity * 3.85;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- default:
- Console.WriteLine("error");
- break;
- }
- break;
- case "Saturday":
- switch (fruit)
- {
- case "banana":
- fruitPrice = quantity * 2.70;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "apple":
- fruitPrice = quantity * 1.25;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "orange":
- fruitPrice = quantity * 0.90;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "grapefruit":
- fruitPrice = quantity * 1.60;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "kiwi":
- fruitPrice = quantity * 3.00;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "pineapple":
- fruitPrice = quantity * 5.60;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "grapes":
- fruitPrice = quantity * 4.20;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- default:
- Console.WriteLine("error");
- break;
- }
- break;
- case "Sunday":
- switch (fruit)
- {
- case "banana":
- fruitPrice = quantity * 2.70;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "apple":
- fruitPrice = quantity * 1.25;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "orange":
- fruitPrice = quantity * 0.90;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "grapefruit":
- fruitPrice = quantity * 1.60;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "kiwi":
- fruitPrice = quantity * 3.00;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "pineapple":
- fruitPrice = quantity * 5.60;
- Console.WriteLine($"{fruitPrice:f2}");
- break;
- case "grapes":
- fruitPrice = quantity * 4.20;
- Console.WriteLine( $"{fruitPrice:f2}");
- break;
- default:
- Console.WriteLine("error");
- break;
- }
- break;
- default:
- Console.WriteLine("error");
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement