Advertisement
YavorJS

Small Shop

Jun 12th, 2016
626
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. using System;
  2.  
  3. class Program
  4. {
  5. static void Main()
  6. {
  7.  
  8. var product =Console.ReadLine();
  9. var town = Console.ReadLine();
  10. double quantity = double.Parse(Console.ReadLine());
  11. double itemPrice = 0;
  12. double price = 0;
  13. if (town=="Sofia")
  14. {
  15. if (product == "coffee")
  16. {
  17. itemPrice = 0.50;
  18. }
  19. else if (product == "water")
  20. {
  21. itemPrice = 0.80;
  22. }
  23. else if (product == "beer")
  24. {
  25. itemPrice = 1.20;
  26. }
  27. else if (product == "sweets")
  28. {
  29. itemPrice = 1.45;
  30. }
  31. else if (product == "peanuts")
  32. {
  33. itemPrice = 1.60;
  34. }
  35. }
  36. else if (town=="Plovdiv")
  37. {
  38. if (product == "coffee")
  39. {
  40. itemPrice = 0.40;
  41. }
  42. else if (product == "water")
  43. {
  44. itemPrice = 0.70;
  45. }
  46. else if (product == "beer")
  47. {
  48. itemPrice = 1.15;
  49. }
  50. else if (product == "sweets")
  51. {
  52. itemPrice = 1.30;
  53. }
  54. else if (product == "peanuts")
  55. {
  56. itemPrice = 1.50;
  57. }
  58. }
  59. else if (town == "Varna")
  60. {
  61. if (product == "coffee")
  62. {
  63. itemPrice = 0.45;
  64. }
  65. else if (product == "water")
  66. {
  67. itemPrice = 0.70;
  68. }
  69. else if (product == "beer")
  70. {
  71. itemPrice = 1.10;
  72. }
  73. else if (product == "sweets")
  74. {
  75. itemPrice = 1.35;
  76. }
  77. else if (product == "peanuts")
  78. {
  79. itemPrice = 1.55;
  80. }
  81. }
  82.  
  83. price = itemPrice * quantity;
  84. Console.WriteLine(price);
  85. }
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement