desislava777

Hotel

Jun 1st, 2017
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.82 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 ConsoleApplication4
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             //var name = Console.ReadLine();
  14.             //var age = int.Parse(Console.ReadLine());
  15.             //var employeeID = int.Parse(Console.ReadLine());
  16.             //var salary = double.Parse(Console.ReadLine());
  17.             //Console.WriteLine($"Name: {name}");
  18.             //Console.WriteLine($"Age: {age}");
  19.             //Console.WriteLine($"Employee ID: {employeeID:D8}");
  20.             //Console.WriteLine($"Salary: {salary:F2}");
  21.             var month = Console.ReadLine();
  22.             var nightCount = int.Parse(Console.ReadLine());
  23.             double studio = 0;
  24.             double doubl = 0;
  25.             double suite;
  26.             if (month=="May"||month=="October")
  27.             {
  28.                 studio = 50 * nightCount;
  29.                 doubl = 65 * nightCount;
  30.                 suite = 75 * nightCount;
  31.                 if (nightCount>7 && month=="May")
  32.                 {
  33.                     studio = studio - 0.05 * studio;
  34.                 }
  35.                 if (nightCount > 7 && month == "October")
  36.                 {
  37.                     studio = 50 * (nightCount - 1);
  38.                     studio = studio - 0.05 * studio;
  39.                 }
  40.                 Console.WriteLine("Studio: {0:F2} lv.", studio);
  41.                 Console.WriteLine("Double: {0:F2} lv.", doubl);
  42.                 Console.WriteLine("Suite: {0:F2} lv.", suite);
  43.             }
  44.             if (month == "June" || month == "September")
  45.             {
  46.                 studio = 60 * nightCount;
  47.                 doubl = 72 * nightCount;
  48.                 suite = 82 * nightCount;
  49.                 if (nightCount>14)
  50.                 {
  51.                     doubl = doubl - doubl * 0.10;
  52.                 }
  53.                 if (nightCount > 7 && month == "September")
  54.                 {
  55.                     studio = 60 * (nightCount - 1);
  56.                 }
  57.                 Console.WriteLine("Studio: {0:F2} lv.", studio);
  58.                 Console.WriteLine("Double: {0:F2} lv.", doubl);
  59.                 Console.WriteLine("Suite: {0:F2} lv.", suite);
  60.             }
  61.             if (month == "July" || month == "August"||month=="December")
  62.             {
  63.                 studio = 68 * nightCount;
  64.                 doubl = 77 * nightCount;
  65.                 suite = 89 * nightCount;
  66.                 if (nightCount>14)
  67.                 {
  68.                     suite = suite - suite * 0.15;
  69.                 }
  70.                 Console.WriteLine("Studio: {0:F2} lv.", studio);
  71.                 Console.WriteLine("Double: {0:F2} lv.", doubl);
  72.                 Console.WriteLine("Suite: {0:F2} lv.", suite);
  73.             }
  74.         }
  75.     }
  76. }
Advertisement
Add Comment
Please, Sign In to add comment