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