Advertisement
Guest User

hotelRoom

a guest
Apr 5th, 2020
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.87 KB | None | 0 0
  1. using System;
  2.  
  3. namespace hotelRoom
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string month = Console.ReadLine();
  10.             double stay = double.Parse(Console.ReadLine());
  11.             double studio = 0;
  12.             double apartment = 0;
  13.            
  14.             switch (month)
  15.             {
  16.                 case "May || October":
  17.  
  18.                     if (stay > 7)
  19.                     {
  20.                         studio = 50 * 0.95;
  21.                     }
  22.                     if (stay >= 14)
  23.                     {
  24.                         studio = 50 * 0.70;
  25.                         apartment = 65 * 0.90;
  26.                     }
  27.                     if (stay < 7)
  28.                     {
  29.                         studio = 50;
  30.                         apartment = 65;
  31.                     }
  32.                     break;
  33.  
  34.                 case "June || September":
  35.  
  36.                     if (stay >= 14)
  37.                     {
  38.                         studio = 75.20 * 0.80;
  39.                         apartment = 68.70 * 0.90;
  40.                     }
  41.                     if (stay < 14)
  42.                     {
  43.                         studio = 75.20;
  44.                         apartment = 68.70;
  45.                     }
  46.                     break;
  47.  
  48.                 case "July || August":
  49.  
  50.                     if (stay >= 14)
  51.                     {
  52.                         studio = 76;
  53.                         apartment = 77 * 0.90;
  54.                     }
  55.                     if (stay < 7)
  56.                     {
  57.                         studio = 76;
  58.                         apartment = 77;
  59.                     }
  60.                     break;
  61.  
  62.  
  63.  
  64.             }
  65.            
  66.             Console.WriteLine($"Apartment: {apartment * stay:F2}lv.");
  67.             Console.WriteLine($"Studio: {studio * stay:F2}lv.");
  68.  
  69.  
  70.         }
  71.     }
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement