Advertisement
kallyy7

Untitled

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