Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Globalization;
- using System.Linq;
- using System.Text;
- using System.Text.RegularExpressions;
- using System.Threading.Tasks;
- namespace hotelRooms
- {
- class Program
- {
- static void Main(string[] args)
- {
- string month = Console.ReadLine();
- decimal nights = decimal.Parse(Console.ReadLine());
- decimal pricePerNightStudio = 0m;
- decimal pricePerNightDouble = 0m;
- decimal pricePerNightSuite = 0m;
- switch (month)
- {
- case "May":
- case "October":
- pricePerNightStudio = 50m;
- pricePerNightDouble = 65m;
- pricePerNightSuite = 75m;
- break;
- case "June":
- case "September":
- pricePerNightStudio = 60m;
- pricePerNightDouble = 72m;
- pricePerNightSuite = 82m;
- break;
- case "July":
- case "August":
- case "December":
- pricePerNightStudio = 68m;
- pricePerNightDouble = 77m;
- pricePerNightSuite = 89m;
- break;
- }
- decimal studioStay = pricePerNightStudio * nights;
- decimal doubleStay = pricePerNightDouble * nights;
- decimal suiteStay = pricePerNightSuite * nights;
- if (nights > 7 && month == "May")
- {
- studioStay = (pricePerNightStudio * 0.95m) * nights;
- }
- else if (nights > 7 && month == "October")
- {
- studioStay = (pricePerNightStudio * 0.95m) * (nights - 1);
- }
- if (nights > 14 && (month == "June" || month == "September"))
- {
- doubleStay = (pricePerNightDouble * 0.9m) * nights;
- }
- if (nights > 7 && (month == "June" || month == "September"))
- {
- studioStay = pricePerNightStudio * (nights - 1);
- }
- if (nights > 14 && (month == "July" || month == "August" || month == "December"))
- {
- suiteStay = (pricePerNightSuite * 0.85m) * nights;
- }
- Console.WriteLine($"Studio: {studioStay:f2} lv.");
- Console.WriteLine($"Double: {doubleStay:f2} lv.");
- Console.WriteLine($"Suite: {suiteStay:f2} lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement