peponderat

Untitled

Sep 19th, 2016
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.65 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 SmallShop
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var product = Console.ReadLine();
  14. var city = Console.ReadLine();
  15. var quantity = decimal.Parse(Console.ReadLine());
  16.  
  17. var totalPrice = 0m;
  18.  
  19. if (city == "Sofia")
  20. {
  21. if (product == "coffee")
  22. {
  23. totalPrice = quantity * 0.5m;
  24. }
  25. else if (product == "water")
  26. {
  27. totalPrice = quantity * 0.8m;
  28. }
  29. else if (product == "beer")
  30. {
  31. totalPrice = quantity * 1.2m;
  32. }
  33. else if (product == "sweets")
  34. {
  35. totalPrice = quantity * 1.45m;
  36. }
  37. else if (product == "peanuts")
  38. {
  39. totalPrice = quantity * 1.6m;
  40. }
  41. }
  42. else if (city == "Plovdiv")
  43. {
  44. if (product == "coffee")
  45. {
  46. totalPrice = quantity * 0.4m;
  47. }
  48. else if (product == "water")
  49. {
  50. totalPrice = quantity * 0.7m;
  51. }
  52. else if (product == "beer")
  53. {
  54. totalPrice = quantity * 1.15m;
  55. }
  56. else if (product == "sweets")
  57. {
  58. totalPrice = quantity * 1.30m;
  59. }
  60. else if (product == "peanuts")
  61. {
  62. totalPrice = quantity * 1.5m;
  63. }
  64. }
  65. else if (city == "Varna")
  66. {
  67. if (product == "coffee")
  68. {
  69. totalPrice = quantity * 0.45m;
  70. }
  71. else if (product == "water")
  72. {
  73. totalPrice = quantity * 0.70m;
  74. }
  75. else if (product == "beer")
  76. {
  77. totalPrice = quantity * 1.10m;
  78. }
  79. else if (product == "sweets")
  80. {
  81. totalPrice = quantity * 1.35m;
  82. }
  83. else if (product == "peanuts")
  84. {
  85. totalPrice = quantity * 1.55m;
  86. }
  87. }
  88. Console.WriteLine(totalPrice);
  89. }
  90. }
  91. }
Advertisement
Add Comment
Please, Sign In to add comment