Advertisement
koksibg

Hotel

May 30th, 2017
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.20 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Hotel
  4. {
  5.     class Hotel
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string month = Console.ReadLine();
  10.             int nightsCount = int.Parse(Console.ReadLine());
  11.             double pricePerStudio = 0;
  12.             double pricePerDouble = 0;
  13.             double pricePerSuite = 0;
  14.             double totalPricePerStudio = 0;
  15.             double totalPricePerDouble = 0;
  16.             double totalPricePerSuite = 0;
  17.             if (month == "May" || month == "October")
  18.             {
  19.                 pricePerStudio = 50;
  20.                 pricePerDouble = 65;
  21.                 pricePerSuite = 75;
  22.             }
  23.             else if (month == "June" || month == "September")
  24.             {
  25.                 pricePerStudio = 60;
  26.                 pricePerDouble = 72;
  27.                 pricePerSuite = 82;
  28.             }
  29.             else if (month == "July" || month == "August" || month == "December")
  30.             {
  31.                 pricePerStudio = 68;
  32.                 pricePerDouble = 77;
  33.                 pricePerSuite = 89;
  34.             }
  35.             if ((month == "May" || month == "October") && nightsCount > 7)
  36.             {
  37.                 pricePerStudio = 0.95 * pricePerStudio;
  38.             }
  39.             else if ((month == "June" || month == "September") && nightsCount > 14)
  40.             {
  41.                 pricePerDouble = 0.9 * pricePerDouble;
  42.             }
  43.             else if ((month == "July" || month == "August" || month == "December") && nightsCount > 14)
  44.             {
  45.                 pricePerSuite = 0.85 * pricePerSuite;
  46.             }
  47.             totalPricePerStudio = nightsCount * pricePerStudio;
  48.             totalPricePerDouble = nightsCount * pricePerDouble;
  49.             totalPricePerSuite = nightsCount * pricePerSuite;
  50.             if ((month == "September" || month == "October") && nightsCount > 7)
  51.             {
  52.                 totalPricePerStudio = totalPricePerStudio - pricePerStudio;
  53.             }
  54.             Console.WriteLine($"Studio: {totalPricePerStudio:f2} lv.");
  55.             Console.WriteLine($"Double: {totalPricePerDouble:f2} lv.");
  56.             Console.WriteLine($"Suite: {totalPricePerSuite:f2} lv.");
  57.         }
  58.     }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement