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();
- double nights = double.Parse(Console.ReadLine());
- double priceStudio = 0;
- double priceApartment = 0;
- switch (month)
- {
- case "May":
- case "October":
- priceStudio = 50;
- priceApartment = 65;
- if (nights > 14)
- {
- priceStudio *= 0.70;
- priceApartment *= 0.90;
- }
- else if (nights>7)
- {
- priceStudio *= 0.95;
- }
- break;
- case "June":
- case "September":
- priceStudio = 75.20;
- priceApartment = 68.70;
- if (nights > 14)
- {
- priceStudio *= 0.80;
- priceApartment *= 0.90;
- }
- break;
- case "July":
- case "August":
- priceStudio = 76;
- priceApartment = 77;
- if (nights > 14)
- {
- priceApartment *= 0.90;
- }
- break;
- default:
- break;
- }
- double totalApartment = nights * priceApartment;
- double totalStudio = nights * priceStudio;
- Console.WriteLine($"Apartment: {totalApartment:f2} lv.");
- Console.WriteLine($"Studio: {totalStudio:f2} lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement