Advertisement
Guest User

Untitled

a guest
Jan 24th, 2020
756
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 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 people = int.Parse(Console.ReadLine());
  10. string type = Console.ReadLine();
  11. string day = Console.ReadLine();
  12. decimal pricePerPerson = 0;
  13. decimal totalPrice = 0;
  14. if (type == "Students" && day == "Friday")
  15. {
  16. pricePerPerson = 8.45M;
  17. }
  18. else if (type == "Students" && day == "Saturday")
  19. {
  20. pricePerPerson = 9.80M;
  21. }
  22. else if (type == "Students" && day == "Sunday")
  23. {
  24. pricePerPerson = 10.46M;
  25. }
  26. else if (type == "Business" && day == "Friday")
  27. {
  28. pricePerPerson = 10.90M;
  29. }
  30. else if (type == "Business" && day == "Saturday")
  31. {
  32. pricePerPerson = 15.60M;
  33. }
  34. else if (type == "Business" && day == "Sunday")
  35. {
  36. pricePerPerson = 16;
  37. }
  38. else if (type == "Regular" && day == "Friday")
  39. {
  40. pricePerPerson = 15;
  41. }
  42. else if (type == "Regular" && day == "Saturday")
  43. {
  44. pricePerPerson = 20;
  45. }
  46. else if (type == "Regular" && day == "Sunday")
  47. {
  48. pricePerPerson = 22.50M;
  49. }
  50. totalPrice = people * pricePerPerson;
  51. if (type == "Students" && people >= 30)
  52. {
  53. totalPrice = totalPrice * 0.85M;
  54. }
  55. else if (type == "Business" && people >= 100)
  56. {
  57. totalPrice = totalPrice - (pricePerPerson * 10);
  58. }
  59. else if (type == "Regular" && people >=10 && people <= 20)
  60. {
  61. totalPrice = totalPrice * 0.95M;
  62. }
  63. Console.WriteLine($"Total price: {totalPrice:f2}");
  64.  
  65.  
  66. }
  67. }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement