Advertisement
kisame1313

Untitled

Jul 24th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.93 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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement