Advertisement
AlexTasev

04_Hotel

May 16th, 2018
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.96 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _04_Hotel
  4. {
  5.     class Program
  6.     {
  7.         static void Main()
  8.         {
  9.             string month = Console.ReadLine();
  10.             int nightsCount = int.Parse(Console.ReadLine());
  11.  
  12.             double priceStudio = 0;
  13.             double priceDouble = 0;
  14.             double priceSuite = 0;
  15.  
  16.  
  17.             if (month == "May" || month == "October")
  18.             {
  19.                 priceStudio = 50;
  20.                 priceDouble = 65;
  21.                 priceSuite = 75;
  22.  
  23.                 if (nightsCount > 7)
  24.                 {
  25.                     priceStudio -= priceStudio * 0.05;
  26.                 }
  27.             }
  28.  
  29.             else if (month == "June" || month == "September")
  30.             {
  31.                 priceStudio = 60;
  32.                 priceDouble = 72;
  33.                 priceSuite = 82;
  34.  
  35.                 if (nightsCount > 14)
  36.                 {
  37.                     priceDouble -= priceDouble * 0.1;
  38.                 }
  39.             }
  40.             else if (month == "July" || month == "August" || month == "December")
  41.             {
  42.                 priceStudio = 68;
  43.                 priceDouble = 77;
  44.                 priceSuite = 89;
  45.  
  46.                 if (nightsCount > 14)
  47.                 {
  48.                     priceSuite -= priceSuite * 0.15;
  49.                 }
  50.             }
  51.             if (month == "September" && nightsCount > 7)
  52.             {
  53.                 priceStudio *= nightsCount - 1;
  54.             }
  55.             else if (month == "October" && nightsCount > 7)
  56.             {
  57.                 priceStudio *= nightsCount - 1;
  58.             }
  59.             else
  60.             {
  61.                 priceStudio *= nightsCount;
  62.             }
  63.  
  64.             priceDouble *= nightsCount;
  65.             priceSuite *= nightsCount;
  66.  
  67.             Console.WriteLine($"Studio: {priceStudio:f2} lv.");
  68.             Console.WriteLine($"Double: {priceDouble:f2} lv.");
  69.             Console.WriteLine($"Suite: {priceSuite:f2} lv.");
  70.         }
  71.     }
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement