Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main()
- {
- var city = Console.ReadLine().ToLower();
- var sales = double.Parse(Console.ReadLine());
- var comission = -100000.0;
- if (city == "sofia")
- {
- if (0 <= sales && sales <= 500)
- {
- comission = 0.05;
- }
- else if (500 < sales && sales <= 1000)
- {
- comission = 0.07;
- }
- else if (1000 < sales && sales <= 10000)
- {
- comission = 0.08;
- }
- else if (sales > 10000)
- {
- comission = 0.12;
- }
- }
- else if (city == "varna")
- {
- if (0 <= sales && sales <= 500)
- {
- comission = 0.045;
- }
- else if (500 < sales && sales <= 1000)
- {
- comission = 0.075;
- }
- else if (1000 < sales && sales <= 10000)
- {
- comission = 0.10;
- }
- else if (sales > 10000)
- {
- comission = 0.13;
- }
- }
- else if (city == "plovdiv")
- {
- if (0 <= sales && sales <= 500)
- {
- comission = 0.055;
- }
- else if (500 < sales && sales <= 1000)
- {
- comission = 0.08;
- }
- else if (1000 < sales && sales <= 10000)
- {
- comission = 0.12;
- }
- else if (sales > 10000)
- {
- comission = 0.145;
- }
- }
- if (comission >= 0)
- {
- Console.WriteLine("{0:f2}", sales * comission);
- }
- else if (comission < 0)
- {
- Console.WriteLine("error");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement