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());
- double price = 0;
- if (day == "Monday" || day == "Tuesday" || day == "Wednesday" || day == "Thursday" || day == "Friday")
- {
- if (fruits == "banana")
- {
- price = 2.5;
- }
- else if (fruits == "apple")
- {
- price = 1.2;
- }
- else if (fruits == "orange")
- {
- price = 0.85;
- }
- else if (fruits == "grapefruit")
- {
- price = 1.45;
- }
- else if (fruits == "kiwi")
- {
- price = 2.70;
- }
- else if (fruits == "pineapple")
- {
- price = 5.50;
- }
- else if (fruits == "grapes")
- {
- price = 3.85;
- }
- }
- else if (day == "Saturday" || day == "Sunday")
- {
- if (fruits == "banana")
- {
- price = 2.70;
- }
- else if (fruits == "apple")
- {
- price = 1.25;
- }
- else if (fruits == "orange")
- {
- price = 0.90;
- }
- else if (fruits == "grapefruit")
- {
- price = 1.60;
- }
- else if (fruits == "kiwi")
- {
- price = 3;
- }
- else if (fruits == "pineapple")
- {
- price = 5.60;
- }
- else if (fruits == "grapes")
- {
- price = 4.20;
- }
- }
- if (price > 0)
- {
- Console.WriteLine("{0:F2}", price * kolichestvo);
- }
- else
- Console.WriteLine("error");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement