.


:




:

































 

 

 

 





 

.

 

' :

_ _1 _ _N _1 _N

 

 

. .

2. ' ( ' TItem).

3. :

class TObject

{

public:

virtual void Show()=0;};

class TDepartment:public TObject // -

{

protected:

char name[20]; //

TPerson* head; //

TItem* last; // ' TItem

public:

TDepartment(char*,TPerson*);

TDepardment(TDepartment&);

~ TDepartment();

char* GetName();

TPerson* GetHead();

void SetName(char* NAME);

void SetHead(TPerson* p);

void Insert(TObject* p);

virtual void Show()=0;

};

4. ' ( ):

) .

) .

) ײ .

) .

) .

) .

) .

) .

) .

5. ( ) .

6.- - .

, TStudentGroup

void TStudentGroup::ForEach(PF action, float parametr);

action - , ', ( Ҳ), parametr- ..

, , : ,

void MyProc(TObject* p,float rate)

{

if (((TStudent*)p) ->GetGrade()>=rate) cout<<(((TStudent*)p) ->GetName());

}

7. , . .

.

1. .

2. .

3. .

4. '.

5. ( 2).

6. - .

7. .

8. .

9. .

. .

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. , .





:


: 2016-07-29; !; : 323 |


:

:

, .
==> ...

1965 - | 1787 -


© 2015-2024 lektsii.org - -

: 0.014 .