Advertisement
Guest User

Untitled

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