The East African University (Teau) : School of Computer Science and It
The East African University (Teau) : School of Computer Science and It
INSTRUCTIONS
1. The Paper is made up of FIVE (5) Questions, question ONE is compulsory plus any other
TWO questions.
2. Credit is given for legibility, clarity of expressions and use of relevant illustrations.
3. Clearly write your registration number on each answer sheet used.
QUESTION 1
a) Define the following terms as used in advanced C++ (4 marks)
I. Class
II. object
b) Write short notes about the following in relation to classes. (6 marks)
i) Private member
ii) Public member
iii) Protected member
Write a program of your choice to illustrate the member functions listed above. (10 marks)
c) Briefly explain inheritance and write its syntax in relation to classes (10 marks)
QUESTION 2
a) Define polymorphism (4 marks)
b) Explain the following in relation to polymorphism
i) Static resolution
ii) Virtual function
iii) Pure Virtual Functions (12 marks)
c) Differentiate between constructor and destructor as used in C++ (4 marks)
Page | 1
QUESTION 3
a) Templates are the foundation of generic programming, from your knowledge of programming,
i) Write the syntax of Class Template (4 marks)
ii) Write the syntax of Function Template (4 marks)
b) Discuss the use of Standard Template Library in programming (3 marks)
c) Define following in relation to templates
i) Containers
ii) Algorithms
iii) Iterators (9 marks)
QUESTION 4
a) Explain Multithreading (4marks)
b) Write the syntax for creating threads (4marks)
c) Explain the following as used in threads (3 marks @)
i) thread
ii) attr
iii) start_routine
iv) arg
QUESTION 5
a) Write short notes about the following in relation to Multithreading (3 marks @)
i) Process-based
ii) Thread-based
b) Write the syntax for Terminating Threads (4marks)
c) Differentiate between Joining and Detaching Threads (6marks)
d) Define smart pointers (4marks)
END
Page | 2