Advertisement
ivogul

Problem: Hotel

Sep 25th, 2017
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.48 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 Hotel
  8. {
  9.     class Hotel
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string month = Console.ReadLine();
  14.             int nightsCount = int.Parse(Console.ReadLine());
  15.             if (month == "May")
  16.             {
  17.                 if (nightsCount > 7) Console.WriteLine("Studio: {0:f2} lv.", 50 * 0.95 * nightsCount);
  18.                 else Console.WriteLine("Studio: {0:f2} lv.", 50 * nightsCount);
  19.                 Console.WriteLine("Double: {0:f2} lv.", 65 * nightsCount);
  20.                 Console.WriteLine("Suite: {0:f2} lv.", 75 * nightsCount);
  21.             }
  22.             else if (month == "June")
  23.             {
  24.                 Console.WriteLine("Studio: {0:f2} lv.", 60 * nightsCount);
  25.                 if (nightsCount > 14) Console.WriteLine("Double: {0:f2} lv.", 72 * 0.9 * nightsCount);
  26.                 else Console.WriteLine("Double: {0:f2} lv.", 72 * nightsCount);
  27.                 Console.WriteLine("Suite: {0:f2} lv.", 82 * nightsCount);
  28.             }
  29.             else if (month == "July" || month == "August" || month == "December")
  30.             {
  31.                 Console.WriteLine("Studio: {0:f2} lv.", 68 * nightsCount);
  32.                 Console.WriteLine("Double: {0:f2} lv.", 77 * nightsCount);
  33.                 if (nightsCount > 14) Console.WriteLine("Suite: {0:f2} lv.", 89 * 0.85 * nightsCount);
  34.                 else Console.WriteLine("Suite: {0:f2} lv.", 89 * nightsCount);
  35.             }
  36.             else if (month == "September")
  37.             {
  38.                 if (nightsCount > 7) Console.WriteLine("Studio: {0:f2} lv.", 60 * (nightsCount - 1));
  39.                 else Console.WriteLine("Studio: {0:f2} lv.", 60 * nightsCount);
  40.                 if (nightsCount > 14) Console.WriteLine("Double: {0:f2} lv.", 72 * 0.9 * nightsCount);
  41.                 else Console.WriteLine("Double: {0:f2} lv.", 72 * nightsCount);
  42.                 Console.WriteLine("Suite: {0:f2} lv.", 82 * nightsCount);
  43.             }
  44.             else if (month == "October")
  45.             {
  46.                 if (nightsCount > 7) Console.WriteLine("Studio: {0:f2} lv.", 50 * 0.95 * (nightsCount - 1));
  47.                 else Console.WriteLine("Studio: {0:f2} lv.", 50 * nightsCount);
  48.                 Console.WriteLine("Double: {0:f2} lv.", 65 * nightsCount);
  49.                 Console.WriteLine("Suite: {0:f2} lv.", 75 * nightsCount);
  50.             }
  51.         }
  52.     }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement