Anzzhhela98

fgdrhd

Jun 5th, 2020
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.41 KB | None | 0 0
  1. using System;
  2.  
  3. namespace jijiji
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string mounth = Console.ReadLine();
  10.             int nights = int.Parse(Console.ReadLine());
  11.             double priceStudio = 0;
  12.             double priceApartment= 0;
  13.  
  14.             if (mounth == "May"|| mounth=="October")
  15.             {
  16.                 priceStudio = nights * 50;
  17.                 priceApartment = nights * 65;
  18.                 if (nights<=7)
  19.                 {
  20.                     priceStudio *= 0.95;
  21.                 }
  22.                 else if (nights>14)
  23.                 {
  24.                     priceStudio *=0.70;
  25.                 }
  26.             }
  27.             else if (mounth == "June" || mounth == "September")
  28.             {
  29.                 priceStudio = nights * 75.20;
  30.                 priceApartment = nights * 68.70;
  31.                 if (nights>14)
  32.                 {
  33.                     priceStudio *= 0.80;
  34.                 }
  35.             }
  36.             else if (mounth == "July" || mounth == "August")
  37.             {
  38.                 priceStudio = nights * 76;
  39.                 priceApartment = nights * 77;
  40.             }
  41.             if (nights>14)
  42.             {
  43.                 priceApartment *= 0.90;
  44.             }
  45.             Console.WriteLine($"Apartment: {priceApartment:f2} lv.");
  46.             Console.WriteLine($"Studio: {priceStudio:f2} lv.");
  47.         }
  48.     }
  49. }
Add Comment
Please, Sign In to add comment