Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ForTest
- {
- class Program
- {
- static void Main(string[] args)
- {
- //Person man = new Person("Steve", 17, PersonBehavior.Agressive);
- //Console.WriteLine(man.ShowBehavior());
- }
- }
- public enum PersonBehavior { Agressive, Passive, Polite };
- class Person
- {
- public string Name;
- public int Age;
- private PersonBehavior Behavior;
- public Person(string name, int age)
- {
- Name = name;
- Age = age;
- }
- public Person(string name, int age, PersonBehavior behavior)
- {
- Name = name;
- Age = age;
- Behavior = behavior;
- }
- public PersonBehavior ShowBehavior()
- {
- return Behavior;
- }
- }
- class Employee : Person
- {
- protected int Salary;
- public Employee(int salary, string name, int age) : base(name, age)
- {
- Salary = salary;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement