Guest User

Untitled

a guest
Feb 15th, 2017
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.50 KB | None | 0 0
  1. using System;
  2. class Program
  3. {
  4.     static void Main()
  5.     {
  6.         string mounth = Console.ReadLine().ToLower();
  7.         int nights = int.Parse(Console.ReadLine());
  8.         double studio = 0;
  9.         double apartment = 0;
  10.  
  11.         if (mounth == "may" || mounth == "october")
  12.         {
  13.             if (nights > 14)
  14.             {
  15.                 studio = 50 - 0.3 * 50;
  16.                 apartment = 65 - (0.1 * 65);
  17.             }
  18.             else if (nights > 7)
  19.             {
  20.                 studio = 50 - 0.05 * 50;
  21.                 apartment = 65;
  22.             }
  23.             else
  24.             {
  25.                 studio = 50;
  26.                 apartment = 65;
  27.             }
  28.         }
  29.         else if (mounth == "june" || mounth == "september")
  30.         {
  31.             if (nights > 14)
  32.             {
  33.                 studio = 75.20 - 0.2 * 75.20;
  34.                 apartment = 68.70 - (0.1 * 68.70);
  35.             }
  36.             else
  37.             {
  38.                 studio = 75.20;
  39.                 apartment = 68.70;
  40.             }
  41.         }
  42.         else if (mounth == "july" || mounth == "august")
  43.         {
  44.             if (nights > 14)
  45.             {
  46.                 studio = 76;
  47.                 apartment = 77 - (0.1 * 77);
  48.             }
  49.             else
  50.             {
  51.                 studio = 76;
  52.                 apartment = 77;
  53.             }
  54.         }
  55.         Console.WriteLine("Apartment: {0:f2} lv.", apartment * nights);
  56.         Console.WriteLine("Studio: {0:f2} lv.", studio * nights);
  57.     }
  58. }
Add Comment
Please, Sign In to add comment