Advertisement
Yanislav29

Untitled

Jan 23rd, 2020
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 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 Soft_Uni
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int people = int.Parse(Console.ReadLine());
  14. string type = Console.ReadLine();
  15. string day = Console.ReadLine();
  16.  
  17. decimal price = 0;
  18. switch (type)
  19. {
  20. case "Students":
  21. switch (day)
  22. {
  23. case "Friday":
  24. price = 8.45M;
  25. break;
  26. case "Saturday":
  27. price = 9.8M;
  28. break;
  29. case "Sunday":
  30. price = 10.46M;
  31. break;
  32.  
  33. }
  34. break;
  35. case "Business":
  36.  
  37. switch (day)
  38. {
  39. case "Friday":
  40. price = 10.9M;
  41. break;
  42. case "Saturday":
  43. price = 15.6M;
  44. break;
  45. case "Sunday":
  46. price = 16M;
  47. break;
  48.  
  49. }
  50. break;
  51. case "Regular":
  52. switch (day)
  53. {
  54. case "Friday":
  55. price = 15M;
  56. break;
  57. case "Saturday":
  58. price = 20M;
  59. break;
  60. case "Sunday":
  61. price = 22.5M;
  62. break;
  63.  
  64. }
  65. break;
  66. }
  67. decimal totalPrice = price * people;
  68. if (type == "Students" && people >= 30)
  69. {
  70. totalPrice = totalPrice *0.85M;
  71. }
  72. if(type == "Business" && people >= 100)
  73. {
  74. totalPrice -= people * 10M;
  75. }
  76. if(type == "Regular" && people >= 10 && people <= 20)
  77. {
  78. totalPrice = totalPrice * 0.95M;
  79. }
  80. Console.WriteLine($"Total price: {totalPrice:f2}");
  81.  
  82. }
  83. }
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement