emilia98

04.Hotel- Facebook Nikolay

May 31st, 2017
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.34 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Forumche
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var month = Console.ReadLine();
  14.             var nights = int.Parse(Console.ReadLine());
  15.  
  16.             var priceStudio = 0.0;
  17.             var priceDouble = 0.0;
  18.             var priceSuite = 0.0;
  19.  
  20.             if (month == "May" || month == "October")
  21.             {
  22.                 priceStudio = nights * 50;
  23.                 priceDouble = nights * 65;
  24.                 priceSuite = nights * 75;
  25.             }
  26.             else if (month == "June" || month == "September")
  27.             {
  28.                 priceStudio = nights * 60;
  29.                 priceDouble = nights * 72;
  30.                 priceSuite = nights * 82;
  31.             }
  32.             else if (month == "July" || month == "August" || month == "December")
  33.             {
  34.                 priceStudio = nights * 68;
  35.                 priceDouble = nights * 77;
  36.                 priceSuite = nights * 89;
  37.             }
  38.  
  39.             if ((nights > 7) && (month == "May" || month == "October"))
  40.             {
  41.                 if (month == "October")
  42.                 {
  43.                     priceStudio = (nights - 1) * 50;
  44.                 }
  45.  
  46.                 priceStudio *= 0.95;
  47.             }
  48.             else if ((nights > 14) && (month == "June" || month == "September"))
  49.             {
  50.                 //priceStudio = nights * 60;
  51.                 priceDouble = (nights * 72) * 0.9;
  52.                 //priceSuite = nights * 82;
  53.             }
  54.             else if ((nights > 14) && (month == "July" || month == "August" || month == "December"))
  55.             {
  56.                 //priceStudio = nights * 68;
  57.                // priceDouble = nights * 77;
  58.                 priceSuite = (nights * 89) * 0.85;
  59.             }
  60.             else if ((nights > 7) && (month == "September"))
  61.             {
  62.                 priceStudio = (nights - 1) * 60;
  63.               //  priceDouble = nights * 72;
  64.                // priceSuite = nights * 82;
  65.             }
  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