Advertisement
Guest User

03. Restaurant Discount

a guest
May 24th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.12 KB | None | 0 0
  1. using System;
  2.  
  3. namespace RestaurantDiscount
  4. {
  5.     class Program
  6.     {
  7.         static void Main()
  8.         {
  9.             int groupSize = int.Parse(Console.ReadLine());
  10.             string package = Console.ReadLine();
  11.             int normalPackage = 500;
  12.             int goldenPackage = 750;
  13.             int platinumPackage = 1000;
  14.             int priceSmallHall = 2500;
  15.             int priceTerrace = 5000;
  16.             int priceGreatHall = 7500;
  17.             string hallName = "";
  18.             bool flagg = true;
  19.             double price = 0;
  20.  
  21.             if ((groupSize > 0) && (groupSize <= 50))
  22.             {
  23.                 hallName = "Small Hall";
  24.                 price = priceSmallHall;
  25.             }
  26.             else if (groupSize <= 100)
  27.             {
  28.                 hallName = "Terrace";
  29.                 price = priceTerrace;
  30.             }
  31.             else if (groupSize <= 120)
  32.             {
  33.                 hallName = "Great Hall";
  34.                 price = priceGreatHall;
  35.             }
  36.             else
  37.             {
  38.                 Console.WriteLine("We do not have an appropriate hall.");
  39.                 flagg = false;
  40.             }
  41.  
  42.             if (flagg)
  43.             {
  44.                 if (package == "Normal")
  45.                 {
  46.                     price = (price + normalPackage) * 0.95;
  47.                     Console.WriteLine($"We can offer you the {hallName}");
  48.                     Console.WriteLine($"The price per person is {price / groupSize:f2}$");
  49.                 }
  50.                 else if (package == "Gold")
  51.                 {
  52.                     price = (price + goldenPackage) * 0.9;
  53.                     Console.WriteLine($"We can offer you the {hallName}");
  54.                     Console.WriteLine($"The price per person is {price / groupSize:f2}$");
  55.                 }
  56.                 else
  57.                 {
  58.                     price = (price + platinumPackage) * 0.85;
  59.                     Console.WriteLine($"We can offer you the {hallName}");
  60.                     Console.WriteLine($"The price per person is {price / groupSize:f2}$");
  61.                 }
  62.             }
  63.         }
  64.     }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement