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 TradeComissions
- {
- class Program
- {
- static void Main(string[] args)
- {
- string city = Console.ReadLine().ToLower();
- decimal p = decimal.Parse(Console.ReadLine());
- decimal kom = 0;
- if (city=="sofia")
- {
- if (p >= 0 && p <= 500)
- kom = 0.05m * p;
- else if (p > 500 && p <= 1000)
- kom = 0.07m * p;
- else if (p > 1000 && p <= 10000)
- kom = 0.08m * p;
- else if (p > 10000)
- kom = 0.12m * p;
- }
- else if (city == "varna")
- {
- if (p >= 0 && p <= 500)
- kom = 0.045m * p;
- else if (p > 500 && p <= 1000)
- kom = 0.075m * p;
- else if (p > 1000 && p <= 10000)
- kom = 0.1m * p;
- else if (p > 10000)
- kom = 0.13m * p;
- }
- else if (city == "plovdiv")
- {
- if (p >= 0 && p <= 500)
- kom = 0.055m * p;
- else if (p > 500 && p <= 1000)
- kom = 0.08m * p;
- else if (p > 1000 && p <= 10000)
- kom = 0.12m * p;
- else if (p > 10000)
- kom = 0.145m * p;
- }
- if(kom!=0)
- Console.WriteLine(kom);
- else
- Console.WriteLine("error");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement