Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace HotelRoom
- {
- class Program
- {
- static void Main()
- {
- string month = Console.ReadLine();
- int nights = int.Parse(Console.ReadLine());
- double priceApartment = 0;
- double priceStudio = 0;
- switch (month)
- {
- case "May":
- case "October":
- priceApartment = 65.00;
- priceStudio = 50.00;
- if (nights > 7)
- {
- priceStudio = priceStudio - (priceStudio * 0.05);
- }
- else if (nights > 14)
- {
- priceStudio = priceStudio - (priceStudio * 0.3);
- priceApartment = priceApartment - (priceApartment * 0.1);
- }
- break;
- case "June":
- case "September ":
- priceApartment = 68.70;
- priceStudio = 65.20;
- if (nights > 14)
- {
- priceStudio = priceStudio - (priceStudio * 0.2);
- priceApartment = priceApartment - (priceApartment * 0.1);
- }
- break;
- case "July":
- case "August":
- priceApartment = 77.00;
- priceStudio = 76.00;
- if (nights > 14)
- {
- priceApartment = priceApartment - (priceApartment * 0.1);
- }
- break;
- }
- double stayInApartment = nights * priceApartment;
- double stayInStudio = nights * priceStudio;
- Console.WriteLine($"Apartment: {stayInApartment:f2} lv.");
- Console.WriteLine($"Studio: {stayInStudio:f2} lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement