Advertisement
Guest User

Untitled

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