alexsto

Untitled

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