Advertisement
spasnikolov131

Untitled

Nov 18th, 2020
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.82 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Computer_Room
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. string month = Console.ReadLine(); //march", "april", "may", "june", "july", "august
  10. double CountDaysSpend = double.Parse(Console.ReadLine());
  11. double CountPeopleInGroup = double.Parse(Console.ReadLine());
  12. string TimeOfDay = Console.ReadLine(); // day", "night
  13.  
  14. double price = 0;
  15. double TotalMoney = 0;
  16.  
  17. switch (month)
  18. {
  19. case "march":
  20. if (TimeOfDay == "day")
  21. {
  22. price = 10.50;
  23. }
  24. else if (TimeOfDay == "night")
  25. {
  26. price = 8.40;
  27. }
  28. TotalMoney = (10.50 * CountDaysSpend) * CountPeopleInGroup;
  29. Console.WriteLine($"Price per person for one hour: {price:f2}");
  30. Console.WriteLine($"Total cost of the visit: {TotalMoney:f2}");
  31. break;
  32.  
  33. case "april":
  34. if (TimeOfDay == "day")
  35. {
  36. price = 10.50;
  37. }
  38. else if (TimeOfDay == "night")
  39. {
  40. price = 8.40;
  41. }
  42. TotalMoney = (10.50 * CountDaysSpend) * CountPeopleInGroup;
  43. Console.WriteLine($"Price per person for one hour: {price:f2}");
  44. Console.WriteLine($"Total cost of the visit: {TotalMoney:f2}");
  45. break;
  46. case "may":
  47. if (TimeOfDay == "day")
  48. {
  49. price = 10.50;
  50. }
  51. else if (TimeOfDay == "night")
  52. {
  53. price = 8.40;
  54. }
  55. TotalMoney = (10.50 * CountDaysSpend) * CountPeopleInGroup;
  56. Console.WriteLine($"Price per person for one hour: {price:f2}");
  57. Console.WriteLine($"Total cost of the visit: {TotalMoney:f2}");
  58. break;
  59. case "june":
  60. if (TimeOfDay == "day")
  61. {
  62. price = 12.60;
  63. }
  64. else if (TimeOfDay == "night")
  65. {
  66. price = 10.20;
  67. }
  68. break;
  69. case "july":
  70. if (TimeOfDay == "day")
  71. {
  72. price = 12.60;
  73. }
  74. else if (TimeOfDay == "night")
  75. {
  76. price = 10.20;
  77. price = CountPeopleInGroup - (CountPeopleInGroup * 0.10);
  78. price = price - (CountDaysSpend * 0.50);
  79. }
  80.  
  81. TotalMoney = (price * CountPeopleInGroup) * CountDaysSpend;
  82. Console.WriteLine($"Price per person for one hour: {price:f2}");
  83. Console.WriteLine($"Total cost of the visit: {TotalMoney:f2}");
  84. break;
  85. case "august":
  86. if (TimeOfDay == "day")
  87. {
  88. price = 12.60;
  89. }
  90. else if (TimeOfDay == "night")
  91. {
  92. price = 10.20;
  93. }
  94. Console.WriteLine($"Price per person for one hour: {price:f2}");
  95. Console.WriteLine($"Total cost of the visit: {TotalMoney:f2}");
  96. break;
  97.  
  98. }
  99. }
  100. }
  101. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement