Advertisement
Pazzobg

Temp

May 26th, 2017
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.45 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 Hotel
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var month = Console.ReadLine();
  14.             var nights = int.Parse(Console.ReadLine());
  15.  
  16.             double studioPrice = 0;
  17.             double doublePrice = 0;
  18.             double suitePrice = 0;
  19.  
  20.  
  21.             if (month == "May" || month == "October")
  22.             {
  23.                 if (nights <= 7)
  24.                 {
  25.                     studioPrice = 50 * nights;
  26.                     doublePrice = 65 * nights;
  27.                     suitePrice = 75 * nights;
  28.  
  29.                 }
  30.                 else
  31.                 {
  32.                     studioPrice = (50 * nights) * 0.95;
  33.                     doublePrice = 65 * nights;
  34.                     suitePrice = 75 * nights;
  35.  
  36.  
  37.                 }
  38.  
  39.             }
  40.             else if (month == "June" || month == "September")
  41.             {
  42.                 if (nights <= 14)
  43.                 {
  44.                     studioPrice = 60 * nights;
  45.                     doublePrice = 72 * nights;
  46.                     suitePrice = 82 * nights;
  47.  
  48.                 }
  49.                 else
  50.                 {
  51.                     studioPrice = 60 * nights;
  52.                     doublePrice = (72 * nights) * 0.9;
  53.                     suitePrice = 82 * nights;
  54.  
  55.  
  56.                 }
  57.  
  58.             }
  59.             else if (month == "July" || month == "August" || month == "December")
  60.             {
  61.                 if (nights <= 14)
  62.                 {
  63.                     studioPrice = 68 * nights;
  64.                     doublePrice = 77 * nights;
  65.                     suitePrice = 89 * nights;
  66.  
  67.                 }
  68.                 else
  69.                 {
  70.                     studioPrice = 68 * nights;
  71.                     doublePrice = 77 * nights;
  72.                     suitePrice = (89 * nights) * 0.85;
  73.  
  74.  
  75.                 }
  76.  
  77.             }
  78.             if (month == "September" && nights > 7)
  79.             {
  80.                 studioPrice -= 60;
  81.  
  82.             }
  83.             else if (month == "October" && nights > 7)
  84.             {
  85.                 studioPrice -= 50 * 0.95;
  86.             }
  87.  
  88.             Console.WriteLine("Studio: {0:F2} lv.", studioPrice);
  89.             Console.WriteLine("Double: {0:F2} lv.", doublePrice);
  90.             Console.WriteLine("Suite: {0:F2} lv.", suitePrice);
  91.         }
  92.     }
  93. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement