kisame1313

cafe

Jul 24th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.41 KB | None | 0 0
  1. using System;
  2.  
  3. class Program
  4. {
  5.     static void Main ( string [] args )
  6.     {
  7.         Employee b = new Employee ( "Abdulla", 155, 100.50f );
  8.         Console.WriteLine ( b.Name );
  9.     }
  10.  
  11.     public enum PersonBehavior
  12.     {
  13.         agressive, passive, polite
  14.     }
  15.  
  16.     class Person
  17.     {
  18.         public string Name;
  19.         public int Age;
  20.         private PersonBehavior Behavior;
  21.  
  22.         public Person ( string name, int age, PersonBehavior behavior )
  23.         {
  24.             Name = name;
  25.             Age = age;
  26.             Behavior = behavior;
  27.         }
  28.  
  29.         public Person ( string name, int age )
  30.         {
  31.             Name = name;
  32.             Age = age;
  33.         }
  34.  
  35.         public PersonBehavior ShowBehavior ()
  36.         {
  37.             return Behavior;
  38.         }
  39.     }
  40.  
  41.     class Employee : Person
  42.     {
  43.         protected float Salary;
  44.  
  45.         public Employee ( string name, int age, float salary ) : base ( name, age )
  46.         {
  47.             Salary = salary;
  48.         }
  49.     }
  50.  
  51.     class Waiter : Employee
  52.     {
  53.         public Waiter ( string name, int age, float salary ) : base ( name, age, salary )
  54.         {
  55.  
  56.         }
  57.     }
  58.  
  59.     class Security : Employee
  60.     {
  61.         public Security ( string name, int age, float salary ) : base ( name, age, salary )
  62.         {
  63.  
  64.         }
  65.     }
  66.  
  67.     class Cafe
  68.     {
  69.         private int WaitersCount;
  70.         private int SecurityCount;
  71.         private int MaxWaiters;
  72.         private int MaxSecurities;
  73.         private Employee[] Employers;
  74.  
  75.         public Cafe ( int maxWaiters, int maxSecurities )
  76.         {
  77.             MaxWaiters = maxWaiters;
  78.             MaxSecurities = maxSecurities;
  79.             Employers = new Employee [maxSecurities + maxWaiters];
  80.         }
  81.     }
  82. }
Advertisement
Add Comment
Please, Sign In to add comment