Advertisement
Yanislav29

Untitled

Nov 28th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.43 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 ConsoleApp7
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. string townName = Console.ReadLine();
  14. string packet = Console.ReadLine();
  15. string discount = Console.ReadLine();
  16. int days = int.Parse(Console.ReadLine());
  17. double price = 0;
  18. if(townName == "Bansko" || townName == "Borovets")
  19. {
  20. if(packet == "noEquipment" )
  21. {
  22. price = 80;
  23. if(discount == "yes")
  24. {
  25. price = price - (price * 0.1);
  26. }
  27. }
  28. else if (packet == "withEquipment")
  29. {
  30. price = 100;
  31. if (discount == "yes")
  32. {
  33. price = price - (price * 0.05);
  34. }
  35. else
  36. {
  37. Console.WriteLine("Invalid input!");
  38. }
  39. }
  40.  
  41. }
  42. else if (townName == "Varna" || townName == "Burgas")
  43. {
  44. if (packet == "noBreakfast")
  45. {
  46. price = 100;
  47. if (discount == "yes")
  48. {
  49. price = price - (price * 0.07);
  50. }
  51. }
  52. else if (packet == "withBreakfast")
  53. {
  54. price = 130;
  55. if (discount == "yes")
  56. {
  57. price = price - (price * 0.12);
  58. }
  59. }
  60. else
  61. {
  62. Console.WriteLine("Invalid input!");
  63. }
  64. }
  65. else
  66. {
  67. Console.WriteLine("Invalid input!");
  68. }
  69. if(days > 7)
  70. {
  71. days -= 1;
  72. }
  73. double total = days * price;
  74. if (days < 1)
  75. {
  76. Console.WriteLine("Days must be positive number!");
  77. }
  78. else {
  79. Console.WriteLine($"The price is {total:f2}lv! Have a nice time!");
  80.  
  81. }
  82. }
  83. }
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement