Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp26
- {
- class Program
- {
- static void Main(string[] args)
- {
- string city = Console.ReadLine();
- double sells = double.Parse(Console.ReadLine());
- double commision = 0;
- if (city == "Sofia")
- {
- if (sells >= 0 && sells <= 500)
- {
- commision = sells * 0.05;
- Console.WriteLine($"{commision:f2}");
- }
- else if (sells > 500 && sells <= 1000)
- {
- commision = sells * 0.07;
- Console.WriteLine($"{commision:f2}");
- }
- else if (sells > 1000 && sells <= 10000)
- {
- commision = sells * 0.08;
- Console.WriteLine($"{commision:f2}");
- }
- else if (sells > 10000)
- {
- commision = sells * 0.12;
- Console.WriteLine($"{commision:f2}");
- }
- }
- else if (city == "Varna")
- {
- if (sells >= 0 && sells <= 500)
- {
- commision = sells * 0.045;
- Console.WriteLine($"{commision:f2}");
- }
- else if (sells > 500 && sells <= 1000)
- {
- commision = sells * 0.075;
- Console.WriteLine($"{commision:f2}");
- }
- else if (sells > 1000 && sells <= 10000)
- {
- commision = sells * 0.1;
- Console.WriteLine($"{commision:f2}");
- }
- else if (sells > 10000)
- {
- commision = sells * 0.13;
- Console.WriteLine($"{commision:f2}");
- }
- else
- {
- Console.WriteLine("error");
- }
- }
- else if (city == "Plovdiv")
- {
- if (sells >= 0 && sells <= 500)
- {
- commision = sells * 0.055;
- Console.WriteLine($"{commision:f2}");
- }
- else if (sells > 500 && sells <= 1000)
- {
- commision = sells * 0.08;
- Console.WriteLine($"{commision:f2}");
- }
- else if (sells > 1000 && sells <= 10000)
- {
- commision = sells * 0.12;
- Console.WriteLine($"{commision:f2}");
- }
- else if (sells > 10000)
- {
- commision = sells * 0.145;
- Console.WriteLine($"{commision:f2}");
- }
- else
- {
- Console.WriteLine("error");
- }
- }
- else if (city != "Sofia" && city != "Varna" && city != "Plovdiv")
- {
- Console.WriteLine("error");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement