0% found this document useful (0 votes)
62 views

The East African University (Teau) : School of Computer Science and It

This document contains instructions and questions for an Advanced C++ Programming exam. It is divided into 5 questions. Question 1 asks students to (a) define class and object, (b) explain private, public, and protected members in relation to classes, and write a program to illustrate them, and (c) briefly explain inheritance and its syntax. Question 2 covers (a) defining polymorphism and (b) explaining static resolution, virtual functions, and pure virtual functions in relation to polymorphism, and (c) differentiating between constructors and destructors. Question 3 focuses on (a) class and function templates syntax, (b) using the Standard Template Library, and (c) defining containers, algorithms, and

Uploaded by

clinton koech
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views

The East African University (Teau) : School of Computer Science and It

This document contains instructions and questions for an Advanced C++ Programming exam. It is divided into 5 questions. Question 1 asks students to (a) define class and object, (b) explain private, public, and protected members in relation to classes, and write a program to illustrate them, and (c) briefly explain inheritance and its syntax. Question 2 covers (a) defining polymorphism and (b) explaining static resolution, virtual functions, and pure virtual functions in relation to polymorphism, and (c) differentiating between constructors and destructors. Question 3 focuses on (a) class and function templates syntax, (b) using the Standard Template Library, and (c) defining containers, algorithms, and

Uploaded by

clinton koech
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

THE EAST AFRICAN UNIVERSITY (TEAU)

SCHOOL OF COMPUTER SCIENCE AND IT


DEPARTMENT OF COMPUTER SCIENCE
JAN – APRIL 2019, MAIN EXAMINATION

COURSE : ADVANCED C++ PROGRAMMING


CODE : CIT 4107
TIME : 2 Hours

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.

DO NOT WRITE ANYWHERE ON THIS QUESTION PAPER

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

You might also like