Advertisement
Guest User

vacantion

a guest
Jan 23rd, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp7
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int n = int.Parse(Console.ReadLine());
  10. string type = Console.ReadLine();
  11. string day = Console.ReadLine();
  12. double price = 0;
  13. if (type == "Students")
  14. {
  15. if (day =="Friday")
  16. {
  17. price = 8.45;
  18. }
  19. if (day == "Saturday")
  20. {
  21. price = 9.80;
  22. }
  23. if (day == "Sunday")
  24. {
  25. price = 10.46;
  26. }
  27. if (n>=30)
  28. {
  29. price *= 0.85;
  30. }
  31.  
  32. }
  33. if (type == "Business")
  34. {
  35. if (day == "Friday")
  36. {
  37. price = 10.90;
  38. }
  39. if (day == "Saturday")
  40. {
  41. price = 15.60;
  42. }
  43. if (day == "Sunday")
  44. {
  45. price = 16.00;
  46. }
  47. if (n >=100)
  48. {
  49. n = n - 10;
  50. }
  51.  
  52. }
  53. if (type == "Regular")
  54. {
  55. if (day == "Friday")
  56. {
  57. price = 15;
  58. }
  59. if (day == "Saturday")
  60. {
  61. price = 20;
  62. }
  63. if (day == "Sunday")
  64. {
  65. price = 22.50;
  66. }
  67. if (n >= 10 && n<=20)
  68. {
  69. price *= 0.95;
  70. }
  71.  
  72. }
  73. double totalPrice = price * n;
  74. Console.WriteLine($"Total price: {totalPrice:f2}");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement