Advertisement
Guest User

Untitled

a guest
Sep 26th, 2016
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 5.88 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 Hotelska_staq
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string month;
  14.             int days;
  15.             double priceS;
  16.             double priceA;
  17.             double wholePs;
  18.             double wholePa;
  19.  
  20.             month = Console.ReadLine();
  21.             days = Convert.ToInt32(Console.ReadLine());
  22.  
  23.             if (month == "May" || month == "October")
  24.             {
  25.                 priceS = 50;
  26.                 priceA = 65;
  27.                 if (days >=7 && days<14)
  28.                 {
  29.  
  30.                     priceS = priceS - (priceS * 5 / 100);
  31.  
  32.                     wholePs = priceS * days;
  33.                     wholePa = priceA * days;
  34.                   
  35.                     Console.WriteLine("Apartment: " + wholePa.ToString("#.00") + " lv.");
  36.                     Console.WriteLine("Studio: " + wholePs.ToString("#.00") + " lv.");
  37.                     
  38.                     
  39.                 }
  40.                 else
  41.                 if (days >= 14)
  42.                 {
  43.  
  44.                     priceS = priceS - (priceS * 30 / 100);
  45.  
  46.                     priceA = priceA - (priceA * 10 / 100);
  47.                     wholePs = priceS * days;
  48.                     wholePa = priceA * days;
  49.  
  50.                     
  51.                     Console.WriteLine("Apartment: " + wholePa.ToString("#.00") + " lv.");
  52.                     Console.WriteLine("Studio: " + wholePs.ToString("#.00") + " lv.");
  53.                     
  54.                 }
  55.                 else
  56.                 {
  57.  
  58.                     wholePs = priceS * days;
  59.                     wholePa = priceA * days;
  60.                     
  61.                     Console.WriteLine("Apartment: " + wholePa.ToString("#.00") + " lv.");
  62.                     Console.WriteLine("Studio: " + wholePs.ToString("#.00") + " lv.");
  63.  
  64.                 }
  65.  
  66.             }
  67.            
  68.                 if (month == "June" || month == "September")
  69.                 {
  70.                     priceS = 75.20;
  71.                     priceA = 68.70;
  72.                     if (days > 13)
  73.                     {
  74.                         priceS = priceS - (priceS * 20 / 100);
  75.                         priceA = priceA - (priceA * 10 / 100);
  76.                         
  77.  
  78.                         wholePs = priceS * days;
  79.                         wholePa = priceA * days;
  80.  
  81.                         Console.WriteLine("Apartment: " + wholePa.ToString("#.00") + " lv.");
  82.                         Console.WriteLine("Studio: " + wholePs.ToString("#.00") + " lv.");
  83.                     }
  84.  
  85.  
  86.                     else
  87.                     {
  88.  
  89.                         wholePs = priceS * days;
  90.                         wholePa = priceA * days;
  91.  
  92.                         Console.WriteLine("Apartment: " + wholePa.ToString("#.00") + " lv.");
  93.                         Console.WriteLine("Studio: " + wholePs.ToString("#.00") + " lv.");
  94.                     }
  95.  
  96.  
  97.                    
  98.                 }
  99.                
  100.  
  101.  
  102.                     if (month == "July" || month == "August")
  103.                     {
  104.                         priceS = 76;
  105.                         priceA = 77;
  106.                         if (days >= 14)
  107.                         {
  108.  
  109.                             priceA = priceA - (priceA * 10 / 100);
  110.  
  111.                             wholePs = priceS * days;
  112.                             wholePa = priceA * days;
  113.  
  114.                             Console.WriteLine("Apartment: " + wholePa.ToString("#.00") + " lv.");
  115.                             Console.WriteLine("Studio: " + wholePs.ToString("#.00") + " lv.");
  116.                         }
  117.                         else
  118.                         {
  119.  
  120.                             wholePs = priceS * days;
  121.                             wholePa = priceA * days;
  122.  
  123.                             Console.WriteLine("Apartment: " + wholePa.ToString("#.00") + " lv.");
  124.                             Console.WriteLine("Studio: " + wholePs.ToString("#.00") + " lv.");
  125.                         }
  126.  
  127.                     }
  128.                 
  129.              
  130.             Console.ReadLine();
  131.         }
  132.    
  133.    }
  134. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement