SHARE
TWEET

Untitled

a guest Feb 27th, 2020 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace _8
  4. {
  5.     class Program
  6.     {
  7.         static void Main()
  8.         {
  9.             var month = Console.ReadLine();
  10.             var numberOfNights = int.Parse(Console.ReadLine());
  11.  
  12.             double mayOctoberStudio = 50.0, mayOctoberApartment = 65.0;
  13.             double juneSeptemberStudio = 75.20, juneSeptemberApartment = 68.70;
  14.             double julyAugustStudio = 76.0, julyAugustApartment = 77.0;
  15.  
  16.             double studioDiscount = 0.0, aparmentDiscount = 0.0;
  17.  
  18.             if(month == "May" || month == "October")
  19.             {
  20.                 if (numberOfNights > 7 && numberOfNights <= 14)
  21.                     studioDiscount = mayOctoberStudio / 20.0;
  22.                 else if (numberOfNights > 14)
  23.                 {
  24.                     studioDiscount = 3.0 * mayOctoberStudio / 10.0;
  25.                     aparmentDiscount = mayOctoberApartment / 10.0;
  26.                 }
  27.  
  28.                 Console.WriteLine("Apartment: {0:0.00} lv.",mayOctoberApartment * numberOfNights - aparmentDiscount * numberOfNights);
  29.                 Console.WriteLine("Studio: {0:0.00} lv.",mayOctoberStudio * numberOfNights - studioDiscount * numberOfNights);
  30.  
  31.             }
  32.             else if(month == "June" || month == "September")
  33.             {
  34.                 if (numberOfNights > 14)
  35.                 {
  36.                     studioDiscount = juneSeptemberStudio / 5.0;
  37.                     aparmentDiscount = juneSeptemberApartment / 10.0;
  38.                 }
  39.                 Console.WriteLine("Apartment: {0:0.00} lv.", juneSeptemberApartment * numberOfNights - aparmentDiscount * numberOfNights);
  40.                 Console.WriteLine("Studio: {0:0.00} lv.", juneSeptemberStudio * numberOfNights - studioDiscount * numberOfNights);
  41.             }
  42.             else if(month == "July" || month == "August")
  43.             {
  44.                 if (numberOfNights > 14)
  45.                 {
  46.                     aparmentDiscount = julyAugustApartment / 10.0;
  47.                 }
  48.                 Console.WriteLine("Apartment: {0:0.00} lv.", julyAugustApartment * numberOfNights - aparmentDiscount * numberOfNights);
  49.                 Console.WriteLine("Studio: {0:0.00} lv.", julyAugustStudio * numberOfNights - studioDiscount * numberOfNights);
  50.             }
  51.  
  52.         }
  53.     }
  54. }
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