Advertisement
Amiblind

Untitled

Oct 22nd, 2020
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. using System;
  2.  
  3. namespace SmallShop
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. string Drink = Console.ReadLine();
  10. string Town = Console.ReadLine();
  11. double Quantity = double.Parse(Console.ReadLine());
  12.  
  13. double price = 0;
  14.  
  15. if (Town == "Sofia" && Drink == "coffee")
  16. {
  17. price = Quantity * 0.50;
  18. }
  19. else if (Town == "Plovdiv" && Drink == "coffee")
  20. {
  21. price = Quantity * 0.40;
  22. }
  23. else if (Town == "Varna" && Drink == "coffee")
  24. {
  25. price = Quantity * 0.45; ;
  26. }
  27. else if (Town == "Sofia" && Drink == "water")
  28. {
  29. price = Quantity * 0.80;
  30. }
  31. else if (Town == "Plovdiv" || Town == "Varna" && Drink == "water")
  32. {
  33. price = Quantity * 0.70;
  34. }
  35. else if (Town == "Sofia" && Drink == "beer")
  36. {
  37. price = Quantity * 1.20;
  38. }
  39. else if (Town == "Plovdiv" && Drink == "beer")
  40. {
  41. price = Quantity * 1.15;
  42. }
  43. else if (Town == "Varna" && Drink == "beer")
  44. {
  45. price = Quantity * 1.10;
  46. }
  47. else if (Town == "Sofia" && Drink == "sweets")
  48. {
  49. price = Quantity * 1.45;
  50. }
  51. else if (Town == "Plovdiv" && Drink == "sweets")
  52. {
  53. price = Quantity * 1.30;
  54. }
  55. else if (Town == "Varna" && Drink == "sweets")
  56. {
  57. price = Quantity * 1.35;
  58. }
  59. else if (Town == "Sofia" && Drink == "peanuts")
  60. {
  61. price = Quantity * 1.60;
  62. }
  63. else if (Town == "Plovdiv" && Drink == "peanuts")
  64. {
  65. price = Quantity * 1.50;
  66. }
  67. else if (Town == "Varna" && Drink == "peanuts")
  68. {
  69. price = Quantity * 1.55;
  70. }
  71. Console.WriteLine($"{price:F2}") ;
  72. }
  73. }
  74. }
  75.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement