bacco

Почивката на Дядо Коледа: Santas Holiday

Feb 7th, 2018
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.05 KB | None | 0 0
  1. using System;
  2.  
  3. namespace tESt
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             var days = double.Parse(Console.ReadLine());
  10.             var type = Console.ReadLine().ToLower();
  11.             var evaluation = Console.ReadLine().ToLower();
  12.  
  13.             double price = 0;
  14.  
  15.             if (days < 10)
  16.             {
  17.                 if (type == "room for one person")
  18.                 {
  19.                     price = days * 18;
  20.                 }
  21.                 else if (type == "apartment")
  22.                 {
  23.                     price = (days - 1) * 25  * 0.70;
  24.                 }
  25.                 else if (type == "president apartment")
  26.                 {
  27.                     price = (days - 1) * 35  * 0.90;
  28.                 }
  29.             }
  30.             else if (days >= 10  && days <= 15)
  31.             {
  32.                 if (type == "room for one person")
  33.                 {
  34.                     price = (days - 1) * 18;
  35.                 }
  36.                 else if (type == "apartment")
  37.                 {
  38.                     price = (days - 1) * 25 * 0.65;
  39.                 }
  40.                 else if (type == "president apartment")
  41.                 {
  42.                     price = (days - 1) * 35 * 0.85;
  43.                 }
  44.             }
  45.             else if (days >= 15)
  46.             {
  47.                 if (type == "room for one person")
  48.                 {
  49.                     price = (days-1) * 18;
  50.                 }
  51.                 else if (type == "apartment")
  52.                 {
  53.                     price = (days - 1) * 25  * 0.50;
  54.                 }
  55.                 else if (type == "president apartment")
  56.                 {
  57.                     price = (days - 1) * 35 * 0.80;
  58.                 }
  59.             }
  60.  
  61.             if (evaluation == "positive")
  62.             {
  63.                 price = price + (price * 0.25);
  64.             }
  65.             if (evaluation == "negative")
  66.             {
  67.                 price = price - (price * 0.10);
  68.             }
  69.             Console.WriteLine($"{price:f2}");
  70.         }
  71.     }
  72. }
Advertisement
Add Comment
Please, Sign In to add comment