LachoTodorov

Untitled

May 17th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.95 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 totalPrice = 0;
  13.             double packagePrice = 0;
  14.             string hallName = null;
  15.             double discount = 0;
  16.  
  17.             if (people <= 50)
  18.             {
  19.                 hallName = "Small Hall";
  20.                 Console.WriteLine($"We can offer you the {hallName}");
  21.                 totalPrice = 2500;
  22.             }
  23.             else if (people <= 100)
  24.             {
  25.                 hallName = "Terrace";
  26.                 Console.WriteLine($"We can offer you the {hallName}");
  27.                 totalPrice = 5000;
  28.             }
  29.             else if (people <= 120)
  30.             {
  31.                 hallName = "Great Hall";
  32.                 Console.WriteLine($"We can offer you the {hallName}");
  33.                 totalPrice = 7500;
  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.                     packagePrice = 500;
  45.                     discount = Math.Abs((totalPrice + packagePrice) * 0.05);
  46.                     break;
  47.                 case "Gold":
  48.                     packagePrice = 750;
  49.                     discount = Math.Abs((totalPrice + packagePrice) * 0.10);
  50.                     break;
  51.                 case "Platinium":
  52.                     packagePrice = 1000;
  53.                     discount = Math.Abs((totalPrice + packagePrice) * 0.15);
  54.                     break;
  55.             }
  56.  
  57.                 totalPrice = Math.Abs((totalPrice - discount) / people);
  58.                 Console.WriteLine($"The price per person is {totalPrice:f2}$");
  59.         }
  60.     }
  61. }
Add Comment
Please, Sign In to add comment