Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _05.HotelRoom
- {
- class HotelRoom
- {
- static void Main(string[] args)
- {
- string month = Console.ReadLine().ToLower();
- int nights = int.Parse(Console.ReadLine());
- double priceStudio = 0.0;
- double priceAppartment = 0.0;
- double endPriceStudio = 0.0;
- double endPriceApp = 0.0;
- if (month == "may" || month == "october")
- {
- priceStudio += 50;
- priceAppartment += 65;
- }
- else if (month == "june" || month == "september")
- {
- priceStudio += 75.20;
- priceAppartment += 68.70;
- }
- else if (month == "july" || month == "august")
- {
- priceStudio += 76;
- priceAppartment += 77;
- }
- endPriceStudio = nights * priceStudio;
- endPriceApp = nights * priceAppartment;
- if (nights > 14 && (month == "may" || month == "october"))
- {
- endPriceStudio -= (endPriceStudio * 0.3);
- }
- else if ((nights > 7 && nights <= 14) && (month == "may" || month == "october"))
- {
- endPriceStudio -= (endPriceStudio * 0.05);
- }
- if (nights > 14 && (month == "june" || month == "september"))
- {
- endPriceStudio -= (endPriceStudio * 0.2);
- }
- if (nights > 14)
- {
- endPriceApp -= (endPriceApp * 0.10);
- }
- Console.WriteLine("Apartment: {0:f2} lv.", endPriceApp);
- Console.WriteLine("Studio: {0:f2} lv.", endPriceStudio);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement