Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Hotel_Room
- {
- class Program
- {
- static void Main(string[] args)
- {
- string month = Console.ReadLine();
- int nights = int.Parse(Console.ReadLine());
- double studio = 0;
- double discountStudio = 0;
- double apartment = 0;
- double discountApartment = 0;
- switch (month)
- {
- case "May":
- case "October":
- studio = 50;
- apartment = 65;
- break;
- case "June":
- case "September":
- studio = 75.20;
- apartment = 68.70;
- break;
- case "July":
- case "August":
- studio = 76;
- apartment = 77;
- break;
- }
- if (nights > 14 && (month == "May" || month == "October"))
- {
- discountStudio = 0.30;
- }
- else if (nights > 14 && (month == "June" || month == "September"))
- {
- discountStudio = 0.20;
- }
- else if (nights > 7 && (month == "May" || month == "October"))
- {
- discountStudio = 0.05;
- }
- if (nights > 14)
- {
- discountApartment = 0.1;
- }
- double finalPriceStudio = nights * studio * (1 - discountStudio);
- double finalPriceApartment = nights * apartment * (1 - discountApartment);
- Console.WriteLine($"Apartment: {finalPriceApartment:F2} lv.");
- Console.WriteLine($"Studio: {finalPriceStudio:F2} lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement