desislava777

Hotel

Jun 1st, 2017
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.38 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 ConsoleApplication4
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var month = Console.ReadLine();
  14.             var nightCount = int.Parse(Console.ReadLine());
  15.             double studio = 0;
  16.             double doubl = 0;
  17.             double suite;
  18.             if (month=="May"||month=="October")
  19.             {
  20.                 studio = 50 * nightCount;
  21.                 doubl = 65 * nightCount;
  22.                 suite = 75 * nightCount;
  23.                 if (nightCount>7 && month=="May")
  24.                 {
  25.                     studio = studio - 0.05 * studio;
  26.                 }
  27.                 if (nightCount > 7 && month == "October")
  28.                 {
  29.                     studio = 50 * (nightCount - 1);
  30.                     studio = studio - 0.05 * studio;
  31.                 }
  32.                 Console.WriteLine("Studio: {0:F2} lv.", studio);
  33.                 Console.WriteLine("Double: {0:F2} lv.", doubl);
  34.                 Console.WriteLine("Suite: {0:F2} lv.", suite);
  35.             }
  36.             if (month == "June" || month == "September")
  37.             {
  38.                 studio = 60 * nightCount;
  39.                 doubl = 72 * nightCount;
  40.                 suite = 82 * nightCount;
  41.                 if (nightCount>14)
  42.                 {
  43.                     doubl = doubl - doubl * 0.10;
  44.                 }
  45.                 if (nightCount > 7 && month == "September")
  46.                 {
  47.                     studio = 60 * (nightCount - 1);
  48.                 }
  49.                 Console.WriteLine("Studio: {0:F2} lv.", studio);
  50.                 Console.WriteLine("Double: {0:F2} lv.", doubl);
  51.                 Console.WriteLine("Suite: {0:F2} lv.", suite);
  52.             }
  53.             if (month == "July" || month == "August"||month=="December")
  54.             {
  55.                 studio = 68 * nightCount;
  56.                 doubl = 77 * nightCount;
  57.                 suite = 89 * nightCount;
  58.                 if (nightCount>14)
  59.                 {
  60.                     suite = suite - suite * 0.15;
  61.                 }
  62.                 Console.WriteLine("Studio: {0:F2} lv.", studio);
  63.                 Console.WriteLine("Double: {0:F2} lv.", doubl);
  64.                 Console.WriteLine("Suite: {0:F2} lv.", suite);
  65.             }
  66.         }
  67.     }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment