desislava777

Small Shop

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