SHARE
TWEET

08.HotelRoom

a guest Feb 27th, 2020 100 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace ConsoleApp15
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string mounth = Console.ReadLine();
  10.             int days = int.Parse(Console.ReadLine());
  11.  
  12.             double studioPrice = 0;
  13.             double apartmentPrice = 0;
  14.             double discount = 0;
  15.             double discount2 = 0;
  16.  
  17.             if (mounth == "May" || mounth == "October")
  18.             {
  19.                 studioPrice = 50 * days;
  20.                 apartmentPrice = 65 * days;
  21.                 if (days > 7 && days <= 14)
  22.                 {
  23.                     discount = 0.05 * studioPrice;
  24.                 }
  25.                 else if (days >= 15)
  26.                 {
  27.                     discount = 0.3 * studioPrice;
  28.                     discount2 = 0.1 * apartmentPrice;
  29.                 }
  30.             }
  31.             else if (mounth == "June" || mounth == "September")
  32.             {
  33.  
  34.                 studioPrice = 75.20 * days;
  35.                 apartmentPrice = 68.70 * days;
  36.                 if (days >= 15)
  37.                 {
  38.                     discount = 0.2 * studioPrice;
  39.                     discount2 = 0.1 * apartmentPrice;
  40.                 }
  41.             }
  42.             else if (mounth == "July" || mounth == "August")
  43.             {
  44.                 studioPrice = 76 * days;
  45.                 apartmentPrice = 77 * days;
  46.                 if (days >= 15)
  47.                 {
  48.                     discount2 = 0.1 * apartmentPrice;
  49.                 }
  50.             }
  51.  
  52.             double apartment = apartmentPrice - discount2;
  53.             double studio = studioPrice - discount;
  54.  
  55.             Console.WriteLine($"Apartment: {apartment:F2} lv.");
  56.             Console.WriteLine($"Studio: {studio:F2} lv.");
  57.         }
  58.     }
  59. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top