Advertisement
XfreeBG

Untitled

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