Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main ( string [] args )
- {
- Employee b = new Employee ( "Abdulla", 155, 100.50f );
- Console.WriteLine ( b.Name );
- }
- public enum PersonBehavior
- {
- agressive, passive, polite
- }
- class Person
- {
- public string Name;
- public int Age;
- private PersonBehavior Behavior;
- public Person ( string name, int age, PersonBehavior behavior )
- {
- Name = name;
- Age = age;
- Behavior = behavior;
- }
- public Person ( string name, int age )
- {
- Name = name;
- Age = age;
- }
- public PersonBehavior ShowBehavior ()
- {
- return Behavior;
- }
- }
- class Employee : Person
- {
- protected float Salary;
- public Employee ( string name, int age, float salary ) : base ( name, age )
- {
- Salary = salary;
- }
- }
- class Waiter : Employee
- {
- public Waiter ( string name, int age, float salary ) : base ( name, age, salary )
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement