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