petarkobakov

Vacation

May 20th, 2020
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Vacation
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int group = int.Parse(Console.ReadLine());
  10. string type = Console.ReadLine();
  11. string day = Console.ReadLine();
  12.  
  13. double sum = 0;
  14.  
  15. if (type =="Students")
  16. {
  17. switch (day)
  18. {
  19. case "Friday": sum = group * 8.45; break;
  20. case "Saturday": sum = group * 9.80; break;
  21. case "Sunday": sum = group * 10.46; break;
  22. }
  23. if (group>=30)
  24. {
  25. sum *= 0.85;
  26. }
  27. }
  28. else if (type == "Business")
  29. {
  30. if (group>=100)
  31. {
  32. group -= 10;
  33. }
  34. switch (day)
  35. {
  36. case "Friday":sum = group * 10.90; break;
  37. case "Saturday": sum = group * 15.60; break;
  38. case "Sunday":sum = group * 16; break;
  39. }
  40. }
  41. else if (type == "Regular")
  42. {
  43. switch (day)
  44. {
  45. case "Friday": sum = group * 15; break;
  46. case "Saturday": sum = group * 20; break;
  47. case "Sunday": sum = group * 22.50; break;
  48. }
  49. if (group>=10&&group<=20)
  50. {
  51. sum *= 0.95;
  52. }
  53. }
  54. Console.WriteLine($"Total price: {sum:f2}");
  55. }
  56. }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment