Advertisement
Guest User

Hotel

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