Advertisement
Somo4k

03. MobileOperator

Jun 15th, 2021
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _03._Mobile_operator
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. string contractExpire = Console.ReadLine();
  10. string contractType = Console.ReadLine();
  11. string mobileInternet = Console.ReadLine();
  12. int months = int.Parse(Console.ReadLine());
  13. double price = 0;
  14.  
  15. switch (contractType)
  16. {
  17. case "Small":
  18. if (contractExpire == "one")
  19. {
  20. price = 9.98;
  21. }
  22. else
  23. {
  24. price = 8.58;
  25. }
  26. break;
  27. case "Middle":
  28. if (contractExpire == "one")
  29. {
  30. price = 18.99;
  31. }
  32. else
  33. {
  34. price = 17.09;
  35. }
  36. break;
  37. case "Large":
  38. if (contractExpire == "one")
  39. {
  40. price = 25.98;
  41. }
  42. else
  43. {
  44. price = 23.59;
  45. }
  46. break;
  47. case "ExtraLarge":
  48. if (contractExpire == "one")
  49. {
  50. price = 35.99;
  51. }
  52. else
  53. {
  54. price = 31.79;
  55. }
  56. break;
  57. }
  58.  
  59. switch (mobileInternet)
  60. {
  61. case "yes":
  62. if (price <= 10)
  63. {
  64. price += 5.50;
  65. }
  66. else if (price > 10 && price <= 30)
  67. {
  68. price += 4.35;
  69. }
  70. else
  71. {
  72. price += 3.85;
  73. }
  74. break;
  75. }
  76.  
  77. double totalPrice = price * months;
  78.  
  79. if (contractExpire == "two" )
  80. {
  81. totalPrice *= 0.9625;
  82. Console.WriteLine($"{totalPrice:f2} lv.");
  83. }
  84. else
  85. {
  86. Console.WriteLine($"{totalPrice:f2} lv.");
  87. }
  88. }
  89. }
  90. }
  91.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement