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 YaYuniorLesson9
- {
- class Program
- {
- static void Main(string[] args)
- {
- // Добавьте в класс Person метод, который будет возвращать поведение объекта Person (возвращаемый тип - созданный нами Enum)
- }
- }
- enum PersonBehavior
- {
- Aggressive,
- 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, PersonBehavior behavior)
- {
- Name = name;
- Age = age;
- }
- public PersonBehavior GetBehavior()
- {
- return Behavior;
- }
- }
- class Employee : Person
- {
- protected int Salary;
- public Employee(string name, int age)
- {
- Name = name;
- Age = age;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement