Advertisement
Guest User

Untitled

a guest
Nov 15th, 2019
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. using System;
  2.  
  3. namespace CruiseShip
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. string kindOfCruise = Console.ReadLine();
  10. string kindOfCabin = Console.ReadLine();
  11. int countOfNights = int.Parse(Console.ReadLine());
  12. double sum = 0.00;
  13. double sumOfHoliday = 0.00;
  14. double sumAfterDiscount = 0.00;
  15. double priceOfOneNight = 0.00;
  16. if (kindOfCabin == "standard cabin")
  17. {
  18. if (kindOfCruise == "Mediterranean")
  19. {
  20. priceOfOneNight = 27.50;
  21. }
  22. else if (kindOfCruise == "Adriatic")
  23. {
  24. priceOfOneNight = 22.99;
  25. }
  26. else if (kindOfCruise == "Aegean")
  27. {
  28. priceOfOneNight = 23.00;
  29. }
  30. }
  31. else if (kindOfCabin == "cabin with balcony")
  32. {
  33. if (kindOfCruise == "Mediterranean")
  34. {
  35. priceOfOneNight = 30.20;
  36. }
  37. else if (kindOfCruise == "Adriatic")
  38. {
  39. priceOfOneNight = 25.00;
  40. }
  41. else if (kindOfCruise == "Aegean")
  42. {
  43. priceOfOneNight = 26.60;
  44. }
  45. }
  46. else if (kindOfCabin == "apartment")
  47. {
  48. if (kindOfCruise == "Mediterranean")
  49. {
  50. priceOfOneNight = 40.50;
  51. }
  52. else if (kindOfCruise == "Adriatic")
  53. {
  54. priceOfOneNight = 34.99;
  55. }
  56. else if (kindOfCruise == "Aegean")
  57. {
  58. priceOfOneNight = 39.80;
  59. }
  60. }
  61. if (countOfNights > 7)
  62. {
  63. sum = priceOfOneNight * 4 * countOfNights;
  64. sumAfterDiscount = sum - (sum * 0.25);
  65. sumOfHoliday = sumAfterDiscount;
  66. }
  67. else
  68. {
  69. sumOfHoliday = priceOfOneNight * 4 * countOfNights;
  70. }
  71. Console.WriteLine($"Annie's holiday in the {kindOfCruise} sea costs {sumOfHoliday:F2} lv.");
  72.  
  73. }
  74. }
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement