Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.93 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.             string month = Console.ReadLine();
  14.             int nights = int.Parse(Console.ReadLine());
  15.             double priceST = 0;
  16.             double priceDO = 0;
  17.             double priceSU = 0;
  18.  
  19.             if (month == "May" || month == "October")
  20.             {
  21.                 priceST = 50 * nights;
  22.                 priceDO = 65 * nights;
  23.                 priceSU = 75 * nights;
  24.                
  25.                 if (nights > 7 && month == "October")
  26.                 {
  27.                     priceST = priceST - 50;
  28.                 }
  29.                 if (nights > 7)
  30.                 {
  31.                     priceST = priceST * 0.95;
  32.                 }
  33.             }
  34.  
  35.             else if (month == "June" || month == "September")
  36.             {
  37.                 priceST = 60 * nights;
  38.                 priceDO = 72 * nights;
  39.                 priceSU = 82 * nights;
  40.  
  41.                 if (nights > 7 && month == "September")
  42.                 {
  43.                     priceST = priceST - 60;
  44.                 }
  45.  
  46.                 if (nights > 14)
  47.                 {
  48.                     priceDO = priceDO * 0.9;
  49.                 }              
  50.             }
  51.  
  52.             else if (month == "July" || month == "August" || month == "December")
  53.             {
  54.                 priceST = 68 * nights;
  55.                 priceDO = 77 * nights;
  56.                 priceSU = 89 * nights;
  57.  
  58.                 if (nights > 14)
  59.                 {
  60.                     priceSU = priceSU * 0.85;
  61.                 }              
  62.             }
  63.  
  64.             Console.WriteLine("Studio: {0:f2} lv.", priceST);
  65.             Console.WriteLine("Double: {0:f2} lv.", priceDO);
  66.             Console.WriteLine("Suite: {0:f2} lv.", priceSU);
  67.         }
  68.     }
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement