Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _4.Hotel
- {
- class Program
- {
- static void Main(string[] args)
- {
- string month = Console.ReadLine();
- int nights = int.Parse(Console.ReadLine());
- /*double totalPriceStudio = 0;
- double totalPriceDoubleRoom = 0;
- double totalPriceSuite = 0;*/
- /*if (nights > 14)
- {
- switch (month)
- {
- case "October":
- case "May":
- studio = 50;
- doubleRoom = 65;
- suite = 75;
- break;
- case "September":
- case "June":
- studio = 60;
- doubleRoom = 72;
- suite = 82;
- break;
- case "July":
- case "August":
- case "December":
- studio = 68;
- doubleRoom = 77;
- suite = 89;
- break;
- }
- }
- else if (nights > 7)
- {
- switch (month)
- {
- case "May":
- case "October":
- studio = 50;
- doubleRoom = 65;
- suite = 75;
- break;
- case "June":
- case "September":
- studio = 60;
- doubleRoom = 72;
- suite = 82;
- break;
- case "July":
- case "August":
- case "December":
- studio = 68;
- doubleRoom = 77;
- suite = 89;
- break;
- }
- }*/
- if (month == "May" || month == "October")
- {
- int studio = 50;
- int doubleRoom = 65;
- int suite = 75;
- if (nights > 7)
- {
- double discount = 0.05;
- if (month == "October")
- {
- double totalPriceStudio = (studio * (1 - discount)) * (nights-1);
- double totalPriceDoubleRoom = doubleRoom * nights;
- double totalPriceSuite = suite * nights;
- Console.WriteLine($"Studio: {totalPriceStudio:f2} lv.");
- Console.WriteLine($"Double: {totalPriceDoubleRoom:f2} lv.");
- Console.WriteLine($"Suite: {totalPriceSuite:f2} lv.");
- }
- else
- {
- double totalPriceStudio = (studio * (1 - discount)) * (nights);
- double totalPriceDoubleRoom = doubleRoom * nights;
- double totalPriceSuite = suite * nights;
- Console.WriteLine($"Studio: {totalPriceStudio:f2} lv.");
- Console.WriteLine($"Double: {totalPriceDoubleRoom:f2} lv.");
- Console.WriteLine($"Suite: {totalPriceSuite:f2} lv.");
- }
- }
- }
- else if (month == "June" || month == "September")
- {
- int studio = 60;
- int doubleRoom = 72;
- int suite = 82;
- if (nights > 14 && month == "June")
- {
- double totalPriceStudio = studio * nights;
- double totalPriceDoubleRoom = doubleRoom * (1 - 0.10) * nights;
- double totalPriceSuite = suite * nights;
- Console.WriteLine($"Studio: {totalPriceStudio:f2} lv.");
- Console.WriteLine($"Double: {totalPriceDoubleRoom:f2} lv.");
- Console.WriteLine($"Suite: {totalPriceSuite:f2} lv.");
- }
- else if (month == "September" && nights > 7)
- {
- double totalPriceStudio = studio * (nights - 1);
- double totalPriceDoubleRoom = doubleRoom * nights;
- double totalPriceSuite = suite * nights;
- Console.WriteLine($"Studio: {totalPriceStudio:f2} lv.");
- Console.WriteLine($"Double: {totalPriceDoubleRoom:f2} lv.");
- Console.WriteLine($"Suite: {totalPriceSuite:f2} lv.");
- }
- else if (month == "September" && nights > 14)
- {
- double totalPriceStudio = studio * nights;
- double totalPriceDoubleRoom = doubleRoom * (1 -0.10) * nights;
- double totalPriceSuite = suite * nights;
- Console.WriteLine($"Studio: {totalPriceStudio:f2} lv.");
- Console.WriteLine($"Double: {totalPriceDoubleRoom:f2} lv.");
- Console.WriteLine($"Suite: {totalPriceSuite:f2} lv.");
- }
- else
- {
- double totalPriceStudio = studio * nights;
- double totalPriceDoubleRoom = doubleRoom * nights;
- double totalPriceSuite = suite * nights;
- Console.WriteLine($"Studio: {totalPriceStudio:f2} lv.");
- Console.WriteLine($"Double: {totalPriceDoubleRoom:f2} lv.");
- Console.WriteLine($"Suite: {totalPriceSuite:f2} lv.");
- }
- }
- else if (month == "July" || month == "August" || month == "December")
- {
- int studio = 68;
- int doubleRoom = 77;
- int suite = 89;
- if (nights > 14)
- {
- double totalPriceStudio = studio * nights;
- double totalPriceDoubleRoom = doubleRoom * nights;
- double totalPriceSuite = suite * nights* (1 -0.15);
- Console.WriteLine($"Studio: {totalPriceStudio:f2} lv.");
- Console.WriteLine($"Double: {totalPriceDoubleRoom:f2} lv.");
- Console.WriteLine($"Suite: {totalPriceSuite:f2} lv.");
- }
- }
- // Console.WriteLine($"Studio: {totalPriceStudio} lv.");
- //Console.WriteLine($"Double: {totalPriceDoubleRoom} lv.");
- //Console.WriteLine($"Suite: {totalPriceSuite} lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement