Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _08._Hotel_Room
- {
- class Program
- {
- static void Main(string[] args)
- {
- 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 && nights <= 14)
- {
- priceStudio = priceStudio - priceStudio * 0.05;
- }
- if (nights > 14)
- {
- priceStudio = priceStudio - priceStudio * 0.30;
- priceApartment = priceApartment - priceApartment * 0.1;
- }
- break;
- case "June":
- case "September":
- priceApartment = 68.70;
- priceStudio = 75.20;
- if (nights > 14)
- {
- priceStudio = priceStudio - priceStudio * 0.20;
- 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;
- }
- Console.WriteLine($"Apartment: {priceApartment * nights:f2} lv.");
- Console.WriteLine($"Studio: {priceStudio * nights:f2} lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement