desislava777

mobile operator

Nov 4th, 2017
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.31 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Globalization;
  4. using System.Linq;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication3
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var DurationOfContract = Console.ReadLine();
  14. var TypeOfContract = Console.ReadLine();
  15. var AddedInternet = Console.ReadLine();
  16. int PayingMonths = int.Parse(Console.ReadLine());
  17. double price=0;
  18. if (DurationOfContract == "one")
  19. {
  20. if (TypeOfContract == "Small")
  21. {
  22. if(AddedInternet=="yes")
  23. {
  24. price = (9.98 + 5.50) * PayingMonths;
  25. Console.WriteLine("{0:f2} lv.",price);
  26. }
  27. else if (AddedInternet == "no")
  28. {
  29. price = 9.98 * PayingMonths;
  30. Console.WriteLine("{0:f2} lv.", price);
  31. }
  32. }
  33. else if (TypeOfContract == "Middle")
  34. {
  35. if (AddedInternet == "yes")
  36. {
  37. price = (18.99 + 4.35) * PayingMonths;
  38. Console.WriteLine("{0:f2} lv.", price);
  39. }
  40. else if (AddedInternet == "no")
  41. {
  42. price = 18.99 * PayingMonths;
  43. Console.WriteLine("{0:f2} lv.", price);
  44. }
  45. }
  46. else if (TypeOfContract == "Large")
  47. {
  48. if (AddedInternet == "yes")
  49. {
  50. price = (25.98 + 4.35) * PayingMonths;
  51. Console.WriteLine("{0:f2} lv.", price);
  52. }
  53. else if (AddedInternet == "no")
  54. {
  55. price = 25.98 * PayingMonths;
  56. Console.WriteLine("{0:f2} lv.", price);
  57. }
  58. }
  59. else if (TypeOfContract == "ExtraLarge")
  60. {
  61. if (AddedInternet == "yes")
  62. {
  63. price= (35.99 + 3.85) * PayingMonths;
  64. Console.WriteLine("{0:f2} lv.", price);
  65. }
  66. else if (AddedInternet == "no")
  67. {
  68. price = 35.99 * PayingMonths;
  69. Console.WriteLine("{0:f2} lv.", price);
  70. }
  71. }
  72. }
  73. if (DurationOfContract == "two")
  74. {
  75. if (TypeOfContract == "Small")
  76. {
  77. if(AddedInternet == "yes")
  78. {
  79. price = (8.58+5.50)* PayingMonths;
  80. price = price - price * 0.0375;
  81. Console.WriteLine("{0:f2} lv.", price);
  82. }
  83. else if (AddedInternet == "no")
  84. {
  85. price= 8.58 * PayingMonths;
  86. price = price - price * 0.0375;
  87. Console.WriteLine("{0:f2} lv.", price);
  88. }
  89. }
  90. else if (TypeOfContract == "Middle")
  91. {
  92. if (AddedInternet == "yes")
  93. {
  94. price = (17.09+4.35)* PayingMonths;
  95. price = price - price * 0.0375;
  96. Console.WriteLine("{0:f2} lv.", price);
  97. }
  98. else if (AddedInternet == "no")
  99. {
  100. price = 17.09 * PayingMonths;
  101. price= price - price * 0.0375;
  102. Console.WriteLine("{0:f2} lv.", price);
  103. }
  104.  
  105. }
  106. else if (TypeOfContract == "Large")
  107. {
  108. if (AddedInternet == "yes")
  109. {
  110. price= (23.59+4.35) * PayingMonths;
  111. price = price - price * 0.0375;
  112. Console.WriteLine("{0:f2} lv.", price);
  113. }
  114. else if (AddedInternet == "no")
  115. {
  116. price = 23.59 * PayingMonths;
  117. price= price - price * 0.0375;
  118. Console.WriteLine("{0:f2} lv.", price);
  119. }
  120. }
  121. else if (TypeOfContract == "ExtraLarge")
  122. {
  123. if (AddedInternet == "yes")
  124. {
  125. price= (31.79+3.85) * PayingMonths;
  126. price = price - price * 0.0375;
  127. Console.WriteLine("{0:f2} lv.", price);
  128. }
  129. else if (AddedInternet == "no")
  130. {
  131. price = 31.79 * PayingMonths;
  132. price = price - price * 0.0375;
  133. Console.WriteLine("{0:f2} lv.", price);
  134. }
  135. }
  136. }
  137. }
  138. }
  139. }
Advertisement
Add Comment
Please, Sign In to add comment