Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication1
- {
- class Program
- {
- static void Main(string[] args)
- {
- string product = Console.ReadLine().ToLower();
- string city = Console.ReadLine().ToLower();
- double quantity = double.Parse(Console.ReadLine());
- switch (city)
- {
- case "sofia":
- if (product == "coffee")
- Console.WriteLine("{0:F2}", quantity * 0.50);
- else if (product == "water")
- Console.WriteLine("{0:F2}", quantity * 0.80);
- if (product == "beer")
- Console.WriteLine("{0:F2}", quantity * 1.20);
- if (product == "sweets")
- Console.WriteLine("{0:F2}", quantity * 1.45);
- if (product == "peanuts")
- Console.WriteLine("{0:F2}", quantity * 1.60);
- break;
- case "plovdiv":
- if (product == "coffee")
- Console.WriteLine("{0:F2}", quantity * 0.40);
- if (product == "water")
- Console.WriteLine("{0:F2}", quantity * 0.70);
- if (product == "beer")
- Console.WriteLine("{0:F2}", quantity * 1.15);
- if (product == "sweets")
- Console.WriteLine("{0:F2}", quantity * 1.30);
- if (product == "peanuts")
- Console.WriteLine("{0:F2}", quantity * 1.50);
- break;
- case "varna":
- if (product == "coffee")
- Console.WriteLine("{0:F2}", quantity * 0.45);
- if (product == "water")
- Console.WriteLine("{0:F2}", quantity * 0.70);
- if (product == "beer")
- Console.WriteLine("{0:F2}", quantity * 1.10);
- if (product == "sweets")
- Console.WriteLine("{0:F2}", quantity * 1.35);
- if (product == "peanuts")
- Console.WriteLine("{0:F2}", quantity * 1.55);
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement