TheBulgarianWolf

Restaurant Discount

Dec 11th, 2019
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.73 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.  
  8. namespace _12._12._2019
  9. {
  10.     class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.            
  15.             int people = int.Parse(Console.ReadLine());
  16.             string package = Console.ReadLine();
  17.             double price = 0;
  18.             bool check = true;
  19.             string hall = "";
  20.             if(people > 0 && people <= 50)
  21.             {
  22.                 price = 2500;
  23.                 hall = "small hall";
  24.             }
  25.             else if(people > 50 && people <= 100)
  26.             {
  27.                 price = 5000;
  28.                 hall = "terrace";
  29.             }
  30.             else if(people > 100 && people <= 120)
  31.             {
  32.                 price = 7500;
  33.                 hall = "great hall";
  34.             }
  35.             else
  36.             {
  37.                 Console.WriteLine("We do not have an approprite hall!");
  38.                 check = false;
  39.             }
  40.  
  41.             if (check)
  42.             {
  43.                 if (package == "Normal")
  44.                 {
  45.                     price += 500;
  46.                     price *= 0.95;
  47.                 }
  48.                 else if (package == "Gold")
  49.                 {
  50.                     price += 750;
  51.                     price *= 0.9;
  52.                 }
  53.                 else if (package == "Platinum")
  54.                 {
  55.                     price += 1000;
  56.                     price *= 0.85;
  57.                 }
  58.             }
  59.  
  60.             Console.WriteLine("We can offer you the {0}", hall);
  61.             Console.WriteLine("The price per person is {0:F2}$", price/people);
  62.             Console.ReadLine();
  63.         }
  64.            
  65.     }
  66. }
Add Comment
Please, Sign In to add comment