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 Program
- {
- static void Main()
- {
- string Month = Console.ReadLine();
- int NightCounts = int.Parse(Console.ReadLine());
- double Studio = GetStudioPrices(Month, NightCounts);
- double Double = GetDoublePrices(Month, NightCounts);
- double Suite = GetSuitePrices(Month, NightCounts);
- double TotalStudio = 0;
- if ((Month == "September" || Month == "October") && (NightCounts > 7))
- {
- TotalStudio = Studio * (NightCounts - 1);
- }
- else
- {
- TotalStudio = Studio * NightCounts;
- }
- double TotalDouble = Double * NightCounts;
- double TotalSuite = Suite * NightCounts;
- Console.WriteLine($"Studio: {TotalStudio:f2} lv.");
- Console.WriteLine($"Double: {TotalDouble:f2} lv.");
- Console.WriteLine($"Suite: {TotalSuite:f2} lv.");
- }
- private static double GetSuitePrices(string Month, int NightCounts)
- {
- double Suite = 0;
- if (Month == "May" || Month == "October")
- {
- Suite = 75;
- }
- else if (Month == "June" || Month == "September")
- {
- Suite = 82;
- }
- else
- {
- Suite = 89;
- if (NightCounts > 14)
- {
- Suite = 89 * (1 - 0.15);
- }
- }
- return Suite;
- }
- private static double GetDoublePrices(string Month, int NightCounts)
- {
- double Double = 0;
- if (Month == "May" || Month == "October")
- {
- Double = 65;
- }
- else if (Month == "June" || Month == "September")
- {
- Double = 72;
- if (NightCounts > 14)
- {
- Double = 72 * (1 - 0.1);
- }
- }
- else
- {
- Double = 77;
- }
- return Double;
- }
- private static double GetStudioPrices(string Month, int NightCounts)
- {
- double Studio = 0;
- if (Month == "May" || Month == "October")
- {
- Studio = 50;
- if (NightCounts > 7)
- {
- Studio = 50 * (1 - 0.05);
- }
- }
- else if (Month == "June" || Month == "September")
- {
- Studio = 60;
- }
- else
- {
- Studio = 68;
- }
- return Studio;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement