Advertisement
sivancheva

TradeComission

May 1st, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _08_Trade_Commissions
  8. {
  9. class tradeCommissions
  10. {
  11. static void Main(string[] args)
  12. {
  13.  
  14. double s = double.Parse(Console.ReadLine());
  15. string town = Console.ReadLine().ToLower();
  16. double komissionna = -1;
  17.  
  18. if ((s>=0) && (s <= 500) )
  19. {
  20. if (town == "Sofia")
  21. {
  22. komissionna = 5 / 100 ;
  23. }
  24. else if (town == "Varna")
  25. {
  26. komissionna = 4.5 / 100;
  27. }
  28. else if (town == "Plovdiv")
  29. {
  30. komissionna = 5.5 / 100;
  31. }
  32. }
  33. else if ((s > 500) && (s <= 1000))
  34. {
  35. if (town == "Sofia")
  36. {
  37. komissionna = 7 / 100;
  38. }
  39. else if (town == "Varna")
  40. {
  41. komissionna = 7.5 / 100;
  42. }
  43. else if (town == "Plovdiv")
  44. {
  45. komissionna = 8 / 100 ;
  46. }
  47. }
  48. else if ((s > 100) && (s <= 10000))
  49. {
  50. if (town == "Sofia")
  51. {
  52. komissionna = 8 / 100;
  53. }
  54. else if (town == "Varna")
  55. {
  56. komissionna = 10 / 100;
  57. }
  58. else if (town == "Plovdiv")
  59. {
  60. komissionna = 12 / 100;
  61. }
  62. }
  63. else if (s > 10000)
  64. {
  65. if (town == "Sofia")
  66. {
  67. komissionna = 12 / 100 ;
  68. }
  69. else if (town == "Varna")
  70. {
  71. komissionna = 13 / 100;
  72. }
  73. else if (town == "Plovdiv")
  74. {
  75. komissionna = 14.5 / 100;
  76. }
  77. }
  78. if (komissionna>=0)
  79. {
  80. Console.WriteLine("{0:f2}", komissionna*s);
  81. }
  82.  
  83. else
  84. {
  85. Console.WriteLine("error");
  86. }
  87. }
  88. }
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement