Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace TaxCalculator
- {
- class Program
- {
- static void Main(string[] args)
- {
- int engine = int.Parse(Console.ReadLine());
- string town = Console.ReadLine();
- string euro = Console.ReadLine();
- double price = 0;
- if (engine <= 37)
- {
- switch (town)
- {
- case "Sofia":
- price = 1.43;
- break;
- case "Vidin":
- price = 1.34;
- break;
- case "Varna":
- price = 1.37;
- break;
- default:
- break;
- }
- }
- else if (engine > 37 && engine <= 55)
- {
- switch (town)
- {
- case "Sofia":
- price = 1.50;
- break;
- case "Vidin":
- price = 1.40;
- break;
- case "Varna":
- price = 1.40;
- break;
- default:
- break;
- }
- }
- else if (engine > 55)
- {
- switch (town)
- {
- case "Sofia":
- price = 2.68;
- break;
- case "Vidin":
- price = 2.54;
- break;
- case "Varna":
- price = 2.57;
- break;
- default:
- break;
- }
- }
- double totalPrice = price * engine;
- if (euro == "Euro 4")
- {
- totalPrice *= 0.85;
- }
- else if (euro == "Euro 5")
- {
- totalPrice *= 0.83;
- }
- else if (euro == "Euro 6")
- {
- totalPrice *= 0.80;
- }
- Console.WriteLine($"{totalPrice:f2} lv");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement