Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace CruiseShip
- {
- class Program
- {
- static void Main(string[] args)
- {
- string kindOfCruise = Console.ReadLine();
- string kindOfCabin = Console.ReadLine();
- int countOfNights = int.Parse(Console.ReadLine());
- double sum = 0.00;
- double sumOfHoliday = 0.00;
- double sumAfterDiscount = 0.00;
- double priceOfOneNight = 0.00;
- if (kindOfCabin == "standard cabin")
- {
- if (kindOfCruise == "Mediterranean")
- {
- priceOfOneNight = 27.50;
- }
- else if (kindOfCruise == "Adriatic")
- {
- priceOfOneNight = 22.99;
- }
- else if (kindOfCruise == "Aegean")
- {
- priceOfOneNight = 23.00;
- }
- }
- else if (kindOfCabin == "cabin with balcony")
- {
- if (kindOfCruise == "Mediterranean")
- {
- priceOfOneNight = 30.20;
- }
- else if (kindOfCruise == "Adriatic")
- {
- priceOfOneNight = 25.00;
- }
- else if (kindOfCruise == "Aegean")
- {
- priceOfOneNight = 26.60;
- }
- }
- else if (kindOfCabin == "apartment")
- {
- if (kindOfCruise == "Mediterranean")
- {
- priceOfOneNight = 40.50;
- }
- else if (kindOfCruise == "Adriatic")
- {
- priceOfOneNight = 34.99;
- }
- else if (kindOfCruise == "Aegean")
- {
- priceOfOneNight = 39.80;
- }
- }
- if (countOfNights > 7)
- {
- sum = priceOfOneNight * 4 * countOfNights;
- sumAfterDiscount = sum - (sum * 0.25);
- sumOfHoliday = sumAfterDiscount;
- }
- else
- {
- sumOfHoliday = priceOfOneNight * 4 * countOfNights;
- }
- Console.WriteLine($"Annie's holiday in the {kindOfCruise} sea costs {sumOfHoliday:F2} lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement