YavorJS

shop

May 29th, 2016
678
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 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.  
  8. class Program
  9. {
  10. static void Main()
  11. {
  12. var product = Console.ReadLine().ToLower();
  13. var town = Console.ReadLine().ToLower();
  14. var quantity = double.Parse(Console.ReadLine());
  15. if (town == "sofia")
  16. {
  17. if (product == "coffee")
  18. Console.WriteLine(0.50 * quantity);
  19. else if (product == "water")
  20. Console.WriteLine(0.80 * quantity);
  21. else if (product == "beer")
  22. Console.WriteLine(1.20 * quantity);
  23. else if (product == "sweets")
  24. Console.WriteLine(1.45 * quantity);
  25. else if (product == "peanuts")
  26. Console.WriteLine(1.60 * quantity);
  27. }
  28. else if (town == "plovdiv")
  29. {
  30. if (product == "coffee")
  31. Console.WriteLine(0.40 * quantity);
  32. else if (product == "water")
  33. Console.WriteLine(0.70 * quantity);
  34. else if (product == "beer")
  35. Console.WriteLine(1.15 * quantity);
  36. else if (product == "sweets")
  37. Console.WriteLine(1.30 * quantity);
  38. else if (product == "peanuts")
  39. Console.WriteLine(1.50 * quantity);
  40. }
  41. else if (town == "varna")
  42. {
  43. if (product == "coffee")
  44. Console.WriteLine(0.45 * quantity);
  45. else if (product == "water")
  46. Console.WriteLine(0.70 * quantity);
  47. else if (product == "beer")
  48. Console.WriteLine(1.10 * quantity);
  49. else if (product == "sweets")
  50. Console.WriteLine(1.35 * quantity);
  51. else if (product == "peanuts")
  52. Console.WriteLine(1.55 * quantity);
  53. }
  54. else
  55. {
  56. Console.WriteLine("Not valid");
  57. }
  58. }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment