Advertisement
Guest User

Untitled

a guest
Dec 15th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 KB | None | 0 0
  1. using System;
  2.  
  3. namespace TaxCalculator
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int hoursePower = int.Parse(Console.ReadLine());
  10. string city = Console.ReadLine();
  11. string ecoStandart = Console.ReadLine();
  12. double price = 0;
  13. double pricePercent = 0;
  14. if (city == "Sofia")
  15. {
  16. if (hoursePower >= 37)
  17. {
  18. price = 1.43;
  19. }
  20.  
  21. else if(hoursePower >= 38 || hoursePower <= 55)
  22. {
  23. price = 1.50;
  24. }
  25. else if (hoursePower > 55)
  26. {
  27. price = 2.68;
  28. }
  29. }
  30. else if (city == "Vidin")
  31. {
  32. if (hoursePower >= 37)
  33. {
  34. price = 1.34;
  35. }
  36.  
  37. else if (hoursePower >= 38 || hoursePower <= 55)
  38. {
  39. price = 1.40;
  40. }
  41. else if (hoursePower > 55)
  42. {
  43. price = 2.54;
  44. }
  45. }
  46. else if (city == "Varna")
  47. {
  48. if (hoursePower >= 37)
  49. {
  50. price = 1.37;
  51. }
  52.  
  53. else if (hoursePower >= 38 || hoursePower <= 55)
  54. {
  55. price = 1.40;
  56. }
  57. else if (hoursePower > 55)
  58. {
  59. price = 2.57;
  60. }
  61.  
  62. }
  63. double totalPrice = hoursePower * price;
  64. if (ecoStandart == "Euro 4")
  65. {
  66. pricePercent -= 0.15;
  67. }
  68. else if (ecoStandart == "Euro 5")
  69. {
  70. pricePercent -= 0.17;
  71. }
  72. else if (ecoStandart == "Euro 6")
  73. {
  74. pricePercent -= 0.20;
  75. }
  76. double totalPriceWithPercent = totalPrice - pricePercent;
  77.  
  78. Console.WriteLine($"{totalPriceWithPercent:F2} lv");
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88. }
  89. }
  90. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement