VelizarAvramov

03. Restaurant Discount

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