Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Shop2
- {
- class Program
- {
- static void Main(string[] args)
- {
- // Магазин за плодове през работните дни работи на следните цени:
- // плод banana apple orange grapefruit kiwi pineapple grapes
- // цена 2.50 1.20 0.85 1.45 2.70 5.50 3.85
- //Събота и неделя магазинът работи на по - високи цени:
- // плод banana apple orange grapefruit kiwi pineapple grapes
- //цена 2.70 1.25 0.90 1.60 3.00 5.60 4.20
- string fruits = Console.ReadLine();
- string day = Console.ReadLine();
- double kolichestvo = double.Parse(Console.ReadLine());
- if (day == "Monday" || day == "Tuesday" || day == "Wednesday" || day == "Thursday" || day == "Friday")
- {
- if (fruits == "banana")
- {
- Console.WriteLine($"{kolichestvo * 2.50:F2}");
- }
- else if (fruits == "apple")
- {
- Console.WriteLine($"{kolichestvo * 1.20:F2}");
- }
- else if (fruits == "orange")
- {
- Console.WriteLine($"{kolichestvo * 0.85:F2}");
- }
- else if (fruits == "grapefruit")
- {
- Console.WriteLine($"{kolichestvo * 1.45:F2}");
- }
- else if (fruits == "kiwi")
- {
- Console.WriteLine($"{kolichestvo * 2.70:F2}");
- }
- else if (fruits == "pineapple")
- {
- Console.WriteLine($"{kolichestvo * 5.50:F2}");
- }
- else if (fruits == "grapes")
- {
- Console.WriteLine($"{kolichestvo * 3.85:F2}");
- }
- }
- else if (day == "Saturday" || day == "Sunday")
- {
- if (fruits == "banana")
- {
- Console.WriteLine($"{kolichestvo * 2.70:F2}");
- }
- else if (fruits == "apple")
- {
- Console.WriteLine($"{kolichestvo * 1.25:F2}");
- }
- else if (fruits == "orange")
- {
- Console.WriteLine($"{kolichestvo * 0.90:F2}");
- }
- else if (fruits == "grapefruit")
- {
- Console.WriteLine($"{kolichestvo * 1.60:F2}");
- }
- else if (fruits == "kiwi")
- {
- Console.WriteLine($"{kolichestvo * 3.00:F2}");
- }
- else if (fruits == "pineapple")
- {
- Console.WriteLine($"{kolichestvo * 5.60:F2}");
- }
- else if (fruits == "grapes")
- {
- Console.WriteLine($"{kolichestvo * 4.20:F2}");
- }
- }
- else
- {
- Console.WriteLine("Error");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement