Zhaniartt

Untitled

Nov 1st, 2018
69
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 ConsoleApp8
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. string product = Console.ReadLine();
  14. string town = Console.ReadLine();
  15. double quantity = double.Parse(Console.ReadLine());
  16. double totalPrice = 0;
  17.  
  18.  
  19. if (town == "Sofia")
  20. {
  21. if (product == "coffee")
  22. {
  23. totalPrice = quantity * 0.50;
  24. }
  25. else if (product == "water")
  26. {
  27. totalPrice = quantity * 0.80;
  28. }
  29. else if (product == "beer")
  30. {
  31. totalPrice = quantity * 1.20;
  32. }
  33. else if (product == "sweets")
  34. {
  35. totalPrice = quantity * 1.45;
  36. }
  37. else if (product == "peanuts")
  38. {
  39. totalPrice = quantity * 1.60;
  40. }
  41.  
  42. }
  43. else if (town == "Plovdiv")
  44. {
  45. if (product == "coffee")
  46. {
  47. totalPrice = quantity * 0.40;
  48. }
  49. else if (product == "water")
  50. {
  51. totalPrice = quantity * 0.70;
  52. }
  53. else if (product == "beer")
  54. {
  55. totalPrice = quantity * 1.15;
  56. }
  57. else if (product == "sweets")
  58. {
  59. totalPrice = quantity * 1.30;
  60. }
  61. else if (product == "peanuts")
  62. {
  63. totalPrice = quantity * 1.50;
  64. }
  65. }
  66. else if (town == "Varna")
  67. {
  68. if (product == "coffee")
  69. {
  70. totalPrice = quantity * 0.45;
  71. }
  72. else if (product == "water")
  73. {
  74. totalPrice = quantity * 0.70;
  75. }
  76. else if (product == "beer")
  77. {
  78. totalPrice = quantity * 1.10;
  79. }
  80. else if (product == "sweets")
  81. {
  82. totalPrice = quantity * 1.35;
  83. }
  84. else if (product == "peanuts")
  85. {
  86. totalPrice = quantity * 1.55;
  87. }
  88. }
  89. Console.WriteLine(totalPrice);
  90.  
  91.  
  92. }
  93.  
  94. }
  95. }
Add Comment
Please, Sign In to add comment