Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Hotel
- {
- class Hotel
- {
- static void Main(string[] args)
- {
- string month = Console.ReadLine();
- int nightsCount = int.Parse(Console.ReadLine());
- double pricePerStudio = 0;
- double pricePerDouble = 0;
- double pricePerSuite = 0;
- double totalPricePerStudio = 0;
- double totalPricePerDouble = 0;
- double totalPricePerSuite = 0;
- if (month == "May" || month == "October")
- {
- pricePerStudio = 50;
- pricePerDouble = 65;
- pricePerSuite = 75;
- }
- else if (month == "June" || month == "September")
- {
- pricePerStudio = 60;
- pricePerDouble = 72;
- pricePerSuite = 82;
- }
- else if (month == "July" || month == "August" || month == "December")
- {
- pricePerStudio = 68;
- pricePerDouble = 77;
- pricePerSuite = 89;
- }
- if ((month == "May" || month == "October") && nightsCount > 7)
- {
- pricePerStudio = 0.95 * pricePerStudio;
- }
- else if ((month == "June" || month == "September") && nightsCount > 14)
- {
- pricePerDouble = 0.9 * pricePerDouble;
- }
- else if ((month == "July" || month == "August" || month == "December") && nightsCount > 14)
- {
- pricePerSuite = 0.85 * pricePerSuite;
- }
- totalPricePerStudio = nightsCount * pricePerStudio;
- totalPricePerDouble = nightsCount * pricePerDouble;
- totalPricePerSuite = nightsCount * pricePerSuite;
- if ((month == "September" || month == "October") && nightsCount > 7)
- {
- totalPricePerStudio = totalPricePerStudio - pricePerStudio;
- }
- Console.WriteLine($"Studio: {totalPricePerStudio:f2} lv.");
- Console.WriteLine($"Double: {totalPricePerDouble:f2} lv.");
- Console.WriteLine($"Suite: {totalPricePerSuite:f2} lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement