Advertisement
Guest User

Untitled

a guest
Feb 14th, 2018
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.07 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 _04.Hotel
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string month = Console.ReadLine().ToLower();
  14.             int nights = int.Parse(Console.ReadLine());
  15.             double priceStudio = 0.0;
  16.             double studio = 0.0;
  17.             double doubler = 0.0;
  18.             double suite = 0.0;
  19.  
  20.             if (month == "may" || month == "october")
  21.             {
  22.                 studio = 50;
  23.                 doubler = 65;
  24.                 suite = 75;
  25.                 if (nights > 7)
  26.                 {
  27.                     studio *= 0.95;
  28.                 }
  29.                 if (month == "october" && nights > 7)
  30.                 {
  31.                     priceStudio = (nights - 1) * studio;
  32.                 }
  33.             }
  34.             else if (month == "june" || month == "september")
  35.             {
  36.                 studio = 60;
  37.                 doubler = 72;
  38.                 suite = 82;
  39.                 if (nights > 14)
  40.                 {
  41.                     doubler *= 0.9;
  42.                 }
  43.                 if (month == "september" && nights > 7)
  44.                 {
  45.                     priceStudio = (nights - 1) * studio;
  46.                 }
  47.             }
  48.             else if (month == "july" || month == "august" || month == "december")
  49.             {
  50.                 studio = 68;
  51.                 doubler = 77;
  52.                 suite = 89;
  53.                 if (nights > 14)
  54.                 {
  55.                     suite *= 0.85;
  56.                 }
  57.             }
  58.             if (month == "september" || month == "october")
  59.             {
  60.                 Console.WriteLine($"Studio: {priceStudio:F2} lv.");
  61.             }
  62.             else
  63.             {
  64.                 Console.WriteLine($"Studio: {(studio * nights):F2} lv.");
  65.             }
  66.             Console.WriteLine($"Double: {(doubler * nights):F2} lv.");
  67.             Console.WriteLine($"Suite: {(suite * nights):F2} lv.");
  68.         }
  69.     }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement