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 hoursePower = int.Parse(Console.ReadLine());
- string city = Console.ReadLine();
- string ecoStandart = Console.ReadLine();
- double price = 0;
- double pricePercent = 0;
- if (city == "Sofia")
- {
- if (hoursePower >= 37)
- {
- price = 1.43;
- }
- else if(hoursePower >= 38 || hoursePower <= 55)
- {
- price = 1.50;
- }
- else if (hoursePower > 55)
- {
- price = 2.68;
- }
- }
- else if (city == "Vidin")
- {
- if (hoursePower >= 37)
- {
- price = 1.34;
- }
- else if (hoursePower >= 38 || hoursePower <= 55)
- {
- price = 1.40;
- }
- else if (hoursePower > 55)
- {
- price = 2.54;
- }
- }
- else if (city == "Varna")
- {
- if (hoursePower >= 37)
- {
- price = 1.37;
- }
- else if (hoursePower >= 38 || hoursePower <= 55)
- {
- price = 1.40;
- }
- else if (hoursePower > 55)
- {
- price = 2.57;
- }
- }
- double totalPrice = hoursePower * price;
- if (ecoStandart == "Euro 4")
- {
- pricePercent -= 0.15;
- }
- else if (ecoStandart == "Euro 5")
- {
- pricePercent -= 0.17;
- }
- else if (ecoStandart == "Euro 6")
- {
- pricePercent -= 0.20;
- }
- double totalPriceWithPercent = totalPrice - pricePercent;
- Console.WriteLine($"{totalPriceWithPercent:F2} lv");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement