Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.43 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. switch (town)
  12. {
  13. case "Sofia":
  14. if (product == "coffee")
  15. {
  16. price = 0.50;
  17. }
  18. else if (product == "water")
  19. {
  20. price = 0.80;
  21. }
  22. else if (product == "beer")
  23. {
  24. price = 1.20;
  25. }
  26. else if (product == "sweets")
  27. {
  28. price = 1.45;
  29. }
  30. else if (product == "peanuts")
  31. price = 1.60;
  32. break;
  33. case "Plovdiv":
  34. if (product == "coffee")
  35. {
  36. price = 0.40;
  37. }
  38. else if (product == "water")
  39. {
  40. price = 0.70;
  41. }
  42. else if (product == "beer")
  43. {
  44. price = 1.15;
  45. }
  46. else if (product == "sweets")
  47. {
  48. price = 1.30;
  49. }
  50. else if (product == "peanuts")
  51. price = 1.50;
  52. break;
  53.  
  54. case "Varna":
  55. if (product == "coffee")
  56. {
  57. price = 0.45;
  58. }
  59. else if (product == "water")
  60. {
  61. price = 0.70;
  62. }
  63. else if (product == "beer")
  64. {
  65. price = 1.10;
  66. }
  67. else if (product == "sweets")
  68. {
  69. price = 1.35;
  70. }
  71. else if (product == "peanuts")
  72. price = 1.55;
  73. break;
  74. }
  75. Console.WriteLine(quantity * price);
  76. }
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement