Advertisement
Pecatamaina

Small Shop

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