Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Hotel
- {
- static void Main(string[] args)
- {
- String month = Console.ReadLine().ToLower();
- short nights = short.Parse(Console.ReadLine());
- float studioPrice = 0.0f;
- float doublePrice = 0.0f;
- float suitePrice = 0.0f;
- switch (month)
- {
- case "may":
- case "october":
- studioPrice = 50f;
- doublePrice = 65f;
- suitePrice = 75f;
- if (nights > 7)
- {
- studioPrice *= 0.95f;
- }
- break;
- case "june":
- case "september":
- studioPrice = 60f;
- doublePrice = 72f;
- suitePrice = 82f;
- if (nights > 14)
- {
- doublePrice *= 0.9f;
- }
- break;
- case "july":
- case "august":
- case "december":
- studioPrice = 68f;
- doublePrice = 77f;
- suitePrice = 89f;
- if (nights > 14)
- {
- suitePrice *= 0.85f;
- }
- break;
- default:
- break;
- }
- float moneyForStudio = studioPrice * nights;
- float moneyForDouble = doublePrice * nights;
- float moneyForSuite = suitePrice * nights;
- if (nights > 7 && (month == "september" || month == "october"))
- {
- moneyForStudio = studioPrice * (nights - 1);
- }
- Console.WriteLine($"Studio: {moneyForStudio:F} lv.");
- Console.WriteLine($"Double: {moneyForDouble:F} lv.");
- Console.WriteLine($"Suite: {moneyForSuite:F} lv.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement