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 _4._8.TradeComissions
- {
- class Program
- {
- static void Main(string[] args)
- {
- var town = Console.ReadLine();
- var sell = double.Parse(Console.ReadLine());
- var comission = 0.0;
- if (town == "Sofia")
- {
- if (sell >= 0 && sell <= 500) comission = 0.05;
- else if (sell > 500 && sell <= 1000) comission = 0.07;
- else if (sell > 1000 && sell <= 10000) comission = 0.08;
- else if (sell > 10000) comission = 0.12;
- }
- else if (town == "Varna")
- {
- if (sell >= 0 && sell <= 500) comission = 0.045;
- else if (sell > 500 && sell <= 1000) comission = 0.075;
- else if (sell > 1000 && sell <= 10000) comission = 0.1;
- else if (sell > 10000) comission = 0.13;
- }
- else if (town == "Plovdiv")
- {
- if (sell >= 0 && sell <= 500) comission = 0.055;
- else if (sell > 500 && sell <= 1000) comission = 0.08;
- else if (sell > 1000 && sell <= 10000) comission = 0.12;
- else if (sell > 10000) comission = 0.145;
- }
- var result = sell * comission;
- if (result!=0)
- {
- Console.WriteLine("{0:f2}", result);
- }
- else
- {
- Console.WriteLine("error");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement