Advertisement
Guest User

Untitled

a guest
May 29th, 2017
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. using System;
  2.  
  3.  
  4. namespace _06.Theatre_Promotion
  5. {
  6. class Program
  7. {
  8. static void Main(string[] args)
  9. {
  10. var day = Console.ReadLine().ToLower();
  11. var age = int.Parse(Console.ReadLine());
  12. var price = 0;
  13.  
  14. if (day == "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 (day == "Weekend")
  26. {
  27. if ((age >= 0 && age <= 18) || (age > 64 && age <= 122))
  28. {
  29. price = 15;
  30. }
  31. else if (age > 18 && age <= 64)
  32. {
  33. price = 20;
  34. }
  35. }
  36. if (day == "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