Advertisement
sanyakasarova

Untitled

Aug 14th, 2021
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Exam_Prep
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9.  
  10. string stage = Console.ReadLine();
  11. string ticketType = Console.ReadLine();
  12. int numOfTickets = int.Parse(Console.ReadLine());
  13. char photo = char.Parse(Console.ReadLine());
  14.  
  15. double pricePerTicket = 0;
  16.  
  17. switch (stage)
  18. {
  19. case "Quarter final":
  20. switch (ticketType)
  21. {
  22. case "Standard":
  23. pricePerTicket = 55.50;
  24. break;
  25. case "Premium":
  26. pricePerTicket = 105.20;
  27. break;
  28. case "VIP":
  29. pricePerTicket = 118.90;
  30. break;
  31. }
  32. break;
  33. case "Semi final":
  34. switch (ticketType)
  35. {
  36. case "Standard":
  37. pricePerTicket = 75.88;
  38. break;
  39. case "Premium":
  40. pricePerTicket = 125.22;
  41. break;
  42. case "VIP":
  43. pricePerTicket = 300.40;
  44. break;
  45. }
  46. break;
  47. case "Final":
  48. switch (ticketType)
  49. {
  50. case "Standard":
  51. pricePerTicket = 110.10;
  52. break;
  53. case "Premium":
  54. pricePerTicket = 160.66;
  55. break;
  56. case "VIP":
  57. pricePerTicket = 400;
  58. break;
  59. }
  60. break;
  61. }
  62.  
  63. double totalPrice = pricePerTicket * numOfTickets;
  64. bool hasFreePhoto = false;
  65.  
  66. if (totalPrice > 4000)
  67. {
  68. totalPrice -= totalPrice * 0.25;
  69. hasFreePhoto = true;
  70. }
  71. else if (totalPrice > 2500)
  72. {
  73. totalPrice -= totalPrice * 0.10;
  74. }
  75.  
  76. if (photo == 'Y' && !hasFreePhoto)
  77. {
  78. totalPrice += 40 * numOfTickets;
  79. }
  80.  
  81. Console.WriteLine($"{totalPrice:f2}");
  82. }
  83. }
  84. }
  85.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement