Advertisement
Guest User

Untitled

a guest
Dec 15th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.27 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 engine = int.Parse(Console.ReadLine());
  10. string town = Console.ReadLine();
  11. string euro = Console.ReadLine();
  12. double price = 0;
  13.  
  14. if (engine <= 37)
  15. {
  16. switch (town)
  17. {
  18. case "Sofia":
  19. price = 1.43;
  20. break;
  21. case "Vidin":
  22. price = 1.34;
  23. break;
  24. case "Varna":
  25. price = 1.37;
  26. break;
  27. default:
  28. break;
  29. }
  30.  
  31. }
  32. else if (engine > 37 && engine <= 55)
  33. {
  34. switch (town)
  35. {
  36. case "Sofia":
  37. price = 1.50;
  38. break;
  39. case "Vidin":
  40. price = 1.40;
  41. break;
  42. case "Varna":
  43. price = 1.40;
  44. break;
  45. default:
  46. break;
  47. }
  48.  
  49. }
  50. else if (engine > 55)
  51. {
  52. switch (town)
  53. {
  54. case "Sofia":
  55. price = 2.68;
  56. break;
  57. case "Vidin":
  58. price = 2.54;
  59. break;
  60. case "Varna":
  61. price = 2.57;
  62. break;
  63. default:
  64. break;
  65. }
  66.  
  67. }
  68. double totalPrice = price * engine;
  69.  
  70. if (euro == "Euro 4")
  71. {
  72. totalPrice *= 0.85;
  73.  
  74. }
  75. else if (euro == "Euro 5")
  76. {
  77. totalPrice *= 0.83;
  78.  
  79. }
  80. else if (euro == "Euro 6")
  81. {
  82. totalPrice *= 0.80;
  83.  
  84. }
  85.  
  86. Console.WriteLine($"{totalPrice:f2} lv");
  87.  
  88. }
  89. }
  90. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement