LachoTodorov

Untitled

May 18th, 2018
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.75 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Programming_16_05
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int people = int.Parse(Console.ReadLine());
  10.             string package = Console.ReadLine();
  11.  
  12.             double price = 0;
  13.             double discount = 0;
  14.             string hallName = null;
  15.  
  16.  
  17.             if (people > 100 && people <= 120)
  18.             {
  19.                 hallName = "Great Hall";
  20.                 Console.WriteLine($"We can offer you the {hallName}");
  21.                 price = 7500;
  22.             }
  23.             else if (people > 50 && people <= 100)
  24.             {
  25.                 hallName = "Terrace";
  26.                 Console.WriteLine($"We can offer you the {hallName}");
  27.                 price = 5000;
  28.             }
  29.             else if (people <= 50)
  30.             {
  31.                 hallName = "Small Hall";
  32.                 Console.WriteLine($"We can offer you the {hallName}");
  33.                 price = 2500;
  34.             }
  35.             else
  36.             {
  37.                 Console.WriteLine("We do not have an appropriate hall.");
  38.                 Environment.Exit(0);
  39.             }
  40.  
  41.             switch (package)
  42.             {
  43.                 case "Normal":
  44.                     price += 500;
  45.                     discount = price * 0.05;
  46.                     break;
  47.                 case "Gold":
  48.                     price += 750;
  49.                     discount = price * 0.10;
  50.                     break;
  51.                 case "Platinum":
  52.                     price += 1000;
  53.                     discount = price * 0.15;
  54.                     break;
  55.             }
  56.  
  57.             price = ((price - discount) / people);
  58.             Console.WriteLine($"The price per person is {price:f2}$");
  59.         }
  60.     }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment