anizko

08. Hotel Room

Apr 1st, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.11 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Hotel_Room
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.            
  10.             string Mounth = Console.ReadLine();
  11.             double CountNigth = double.Parse(Console.ReadLine());
  12.  
  13.             double priceA = 0;
  14.             double priceS = 0;
  15.  
  16.             if (Mounth == "May" || Mounth == "October")
  17.             {
  18.                 if (CountNigth > 7 && CountNigth <= 14)
  19.                 {
  20.                     priceA = 65 * CountNigth;
  21.                     priceS = 50 * CountNigth - (50 * CountNigth * 5 / 100);
  22.                 }
  23.                 else if (CountNigth > 14)
  24.                 {
  25.                     priceA = 65 * CountNigth - (65 * CountNigth * 10 / 100);
  26.                     priceS = 50 * CountNigth - (50 * CountNigth * 30 / 100);
  27.                 }
  28.                 else
  29.                 {
  30.                     priceA = 65 * CountNigth;
  31.                     priceS = 50 * CountNigth;
  32.                 }
  33.             }
  34.             else if (Mounth == "June" || Mounth == "September")
  35.                {
  36.                
  37.                 if (CountNigth > 14)
  38.                 {
  39.                     priceA = 68.7 * CountNigth - (68.7 * CountNigth * 10 / 100);
  40.                     priceS = 75.2 * CountNigth - (75.2 * CountNigth * 20 / 100);
  41.                 }
  42.                 else
  43.                 {
  44.                     priceA = 68.7 * CountNigth;
  45.                     priceS = 75.2 * CountNigth;
  46.                 }
  47.             }
  48.  
  49.             else if (Mounth == "July" || Mounth == "August")
  50.                     {
  51.                
  52.                 if (CountNigth > 14)
  53.                 {
  54.                     priceA = 77 * CountNigth - (77 * CountNigth * 10 / 100);
  55.                     priceS = 76 * CountNigth;
  56.                 }
  57.                 else
  58.                 {
  59.                     priceA = 77 * CountNigth;
  60.                     priceS = 76 * CountNigth;
  61.                 }
  62.             }
  63.            
  64.  
  65.             Console.WriteLine($"Apartment: {priceA:f2} lv.");
  66.             Console.WriteLine($"Studio: {priceS:f2} lv.");
  67.         }
  68.     }
  69. }
Advertisement
Add Comment
Please, Sign In to add comment