Guest User

Untitled

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