-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
54 lines (36 loc) · 898 Bytes
/
Program.cs
File metadata and controls
54 lines (36 loc) · 898 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using ClassInheritance;
Employee empl1 = new Employee("Петров", "менеджер");
empl1.Info();
Console.WriteLine();
Manager manager1 = new Manager("Иванов", "руководитель", "отдел лингвистики");
manager1.Info();
Console.WriteLine();
void MakeSound(Animal animal)
{
animal.MakeSound();
}
Dog dog = new Dog();
Cat cat = new Cat();
MakeSound(dog);
MakeSound(cat);
Console.WriteLine();
BankAccount account = new BankAccount(1500, "Иван");
account.Info();
account.Deposite();
account.Info();
Console.WriteLine();
account.TryGetMoney();
account.Info();
Console.WriteLine();
Counter count1 = new Counter(15);
count1.Info();
Counter count2 = new Counter(20);
count2.Info();
count2.Increment();
count2.Increment();
count2.Info();
Counter count3 = new Counter(25);
count3.Info();
count3.Decrement();
count3.Decrement();
count3.Info();