Advertisement
spasnikolov131

Untitled

Jan 17th, 2021
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Theatre_Promotions
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9.  
  10. string typeOfDay = Console.ReadLine().ToLower();
  11. int age = int.Parse(Console.ReadLine());
  12. int price = 0;
  13.  
  14. if (typeOfDay == "weekday")
  15. {
  16. if ((age >= 0 && age <= 18) || (age > 64 && age <= 122))
  17. {
  18. price = 12;
  19. }
  20. else if (age > 18 && age <= 64)
  21. {
  22. price = 18;
  23. }
  24. }
  25. if (typeOfDay == "weekend")
  26. {
  27. if ((age >= 0 && age <= 18) || (age > 18 && age <= 64) || (age > 64 && age <= 122))
  28. {
  29. price = 15;
  30. }
  31. else if (age > 18 && age <= 64)
  32. {
  33. price = 20;
  34. }
  35. }
  36. if (typeOfDay == "holiday")
  37. {
  38. if (age >= 0 && age <= 18)
  39. {
  40. price = 5;
  41. }
  42. else if (age > 18 && age <= 64)
  43. {
  44. price = 12;
  45. }
  46. else if (age > 64 && age <= 122)
  47. {
  48. price = 10;
  49. }
  50. }
  51. if (price != 0)
  52. {
  53. Console.WriteLine(price);
  54. }
  55. else
  56. {
  57. Console.WriteLine("Error");
  58. }
  59. }
  60. }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement