Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string month = Console.ReadLine();
- int nights = int.Parse(Console.ReadLine());
- double studioPrice = 0.0;
- double doublePrice = 0.0;
- double suitePrice = 0.0;
- switch (month)
- {
- case "May":
- case "October":
- studioPrice = 50 * nights;
- doublePrice = 65 * nights;
- suitePrice = 75 * nights;
- break;
- case "June":
- case "September":
- studioPrice = 60 * nights;
- doublePrice = 72 * nights;
- suitePrice = 82 * nights;
- break;
- case "July":
- case "August":
- case "December":
- studioPrice = 68 * nights;
- doublePrice = 77 * nights;
- suitePrice = 89 * nights;
- break;
- }
- if (nights > 7 && month == "September")
- studioPrice -= 60;
- if (nights > 7 && month == "October")
- studioPrice -= 50;
- if (nights > 7 && (month == "May" || month == "October"))
- studioPrice *= 0.95;
- if (nights > 14 && (month == "June" || month == "September"))
- doublePrice *= 0.90;
- if (nights > 14 && (month == "July" || month == "August" || month == "December"))
- suitePrice *= 0.85;
- Console.WriteLine($"Studio: {studioPrice:f2} lv.");
- Console.WriteLine($"Double: {doublePrice:f2} lv.");
- Console.WriteLine($"Suite: {suitePrice:f2} lv.");
Advertisement
Add Comment
Please, Sign In to add comment