Advertisement
VickSuna

Untitled

Feb 27th, 2020
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Izpit_20190706_3._2_Travel_Agency
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. string town = Console.ReadLine();
  10. string package = Console.ReadLine();
  11. string VIP = Console.ReadLine();
  12. int days = int.Parse(Console.ReadLine());
  13.  
  14. double priceFor1Day = 0;
  15.  
  16.  
  17. if (town == "Bansko" || town == "Borovets")
  18. {
  19. if (package == "withEquipment" && VIP == "no")
  20. {
  21. priceFor1Day = 100;
  22. }
  23. else if (package == "withEquipment" && VIP == "yes")
  24. {
  25. priceFor1Day = 100 * 0.90;
  26. }
  27. else if (package == "noEquipment" && VIP == "no")
  28. {
  29. priceFor1Day = 80;
  30. }
  31. else if (package == "noEquipment" && VIP == "yes")
  32. {
  33. priceFor1Day = 80 * 0.95;
  34. }
  35. }
  36. else if (town == "Varna" || town == "Burgas")
  37. {
  38. if (package == "noBreakfast" && VIP == "no")
  39. {
  40. priceFor1Day = 100;
  41. }
  42. else if (package == "noBreakfast" && VIP == "yes")
  43. {
  44. priceFor1Day = 100 * 0.93;
  45. }
  46. else if (package == "withBreakfast" && VIP == "no")
  47. {
  48. priceFor1Day = 130;
  49. }
  50. else if (package == "withBreakfast" && VIP == "yes")
  51. {
  52. priceFor1Day = 130 * 0.88;
  53. }
  54. }
  55.  
  56. if (days > 7)
  57. {
  58. days = days - 1;
  59. }
  60.  
  61. if (days < 1 && (town == "Bansko" || town == "Borovets" || town == "Varna" || town == "Burgas"))
  62. {
  63. Console.WriteLine("Days must be positive number!");
  64. }
  65. else if (days >= 1 && (town == "Bansko" || town == "Borovets" || town == "Varna" || town == "Burgas"))
  66. {
  67. double total = days * priceFor1Day;
  68. Console.WriteLine($"The price is {total:F2}lv! Have a nice time!");
  69. }
  70. else
  71. {
  72. Console.WriteLine("Invalid input!");
  73. }
  74.  
  75.  
  76. }
  77.  
  78.  
  79.  
  80.  
  81. }
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement