Advertisement
IvanBorisovG

Hotel

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