Advertisement
koksibg

HotelRoom

Aug 31st, 2016
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.58 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 HotelRoom
  8. {
  9.     class HotelRoom
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string Month = Console.ReadLine();
  14.             int nights = int.Parse(Console.ReadLine());
  15.             double LastPriceStudio = 0;
  16.             double LastPriceApartment = 0;
  17.             if (nights <= 0)
  18.             {
  19.                 LastPriceStudio = 0;
  20.                 LastPriceApartment = 0;
  21.             }
  22.             else if (nights >= 1 && nights <= 7 && (Month == "May" || Month == "October"))
  23.             {
  24.                 LastPriceStudio = 50;
  25.                 LastPriceApartment = 65;
  26.             }
  27.             else if ((nights >= 1) && (nights <= 7) && (Month == "June" || Month == "September"))
  28.             {
  29.                 LastPriceStudio = 75.2;
  30.                 LastPriceApartment = 68.7;
  31.             }
  32.             else if ((nights >= 1) && (nights <= 7) && (Month == "July" || Month == "August"))
  33.             {
  34.                 LastPriceStudio = 76;
  35.                 LastPriceApartment = 77;
  36.             }
  37.             else if (nights > 7 && nights <= 14 && (Month == "May" || Month == "October"))
  38.             {
  39.                 LastPriceStudio = 50 - 0.05 * 50;
  40.                 LastPriceApartment = 65;
  41.             }
  42.             else if ((nights > 7) && (nights <= 14) && (Month == "June" || Month == "September"))
  43.             {
  44.                 LastPriceStudio = 75.2;
  45.                 LastPriceApartment = 68.7;
  46.             }
  47.             else if ((nights > 7) && (nights <= 14) && (Month == "July" || Month == "August"))
  48.             {
  49.                 LastPriceStudio = 76;
  50.                 LastPriceApartment = 77;
  51.             }
  52.             else if ((nights > 14) && (Month == "May" || Month == "October"))
  53.             {
  54.                 LastPriceStudio = 50 - 0.3 * 50;
  55.                 LastPriceApartment = 65 - 0.1 * 65;
  56.             }
  57.             else if ((nights > 14) && (Month == "June" || Month == "September"))
  58.             {
  59.                 LastPriceStudio = 75.2 - 0.2 * 75.2;
  60.                 LastPriceApartment = 68.7 - 0.1 * 68.7;
  61.             }
  62.             else if ((nights > 14) && (Month == "July" || Month == "August"))
  63.             {
  64.                 LastPriceStudio = 76;
  65.                 LastPriceApartment = 77 - 0.1 * 77;
  66.             }
  67.             Console.WriteLine("Apartment: {0:f2} lv.", nights * LastPriceApartment);
  68.             Console.WriteLine("Studio: {0:f2} lv.", nights * LastPriceStudio);
  69.         }
  70.     }
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement