Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Hotel
- {
- class Hotel
- {
- static void Main(string[] args)
- {
- string month = Console.ReadLine();
- int nights = int.Parse(Console.ReadLine());
- double studio = 0.00;
- double doubleRoom = 0.00;
- double suite = 0.00;
- switch (month)
- {
- case "May":
- case "October":
- studio = 50;
- doubleRoom = 65;
- suite = 75;
- if (nights > 7)
- {
- studio *= 0.95;
- }
- break;
- case "June":
- case "September":
- studio = 60;
- doubleRoom = 72;
- suite = 82;
- if (nights > 14)
- {
- doubleRoom *= 0.90;
- }
- break;
- case "July":
- case "August":
- case "December":
- studio = 68;
- doubleRoom = 77;
- suite = 89;
- if (nights > 14)
- {
- suite *= 0.85;
- }
- break;
- }
- double priceForStudio = nights * studio;
- double priceForDouble = nights * doubleRoom;
- double priceForSuite = nights * suite;
- if ((month == "October" || month == "September") && nights > 7)
- {
- priceForStudio -= studio;
- }
- Console.WriteLine($"Studio: {priceForStudio:f2} lv.");
- Console.WriteLine($"Double: {priceForDouble:f2} lv.");
- Console.WriteLine($"Suite: {priceForSuite:f2} lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement