BIT2108-BBIT203- OBJECT ORIENTED PROGRAMMING.

UNIVERSITY EXAMINATIONS: 2017/2018
EXAMINATION FOR DEGREE OF BACHELOR SCIENCE/BUSINESS
INFORMATION TECHNOLOGY
BIT 2108/BBIT 203: OBJECT ORIENTED PROGRAMMING
MODE: FULL TIME/PART TIME/DISTANCE LEARNING
ORDINARY EXAMINATIONS
DATE: JULY, 2018 DURATION: 2 HOURS
INSTRUCTIONS: Answer Question ONE and any other TWO questions

QUESTION ONE [30 MARKS]
a) Explain the purpose of using iostream header file in a C++ program.
2 Marks
b) Differentiate between stream insertion and stream extraction operators.
2 Marks
c) Explain what is meant by the term method signature.
3 Marks
d) Differentiate between class and structure. With an example explain the syntax for defining a
class
3 Marks
e) Write a C++ program to illustrate hierarchical inheritance.
5 Marks
f) Describe the following concepts as used in object oriented programming.
i. Operator overloading
ii. Function call
iii. Message passing
iv. Function overriding
8 Marks
g) Write a C++ program to print odd numbers between 2 and 20.
4 Marks
h) Discuss how is program modularization achieved in C++.
3 Marks
QUESTION TWO [20 MARKS]
a) Differentiate between early binding and late binding, with an example explain how late
binding can be achieved in C++.
6 Marks
b) Describe the concept of template classes in C++. Give an example.
5 Marks
c) Describe the concept of function abstraction in object oriented programming.
3 Marks
d) Describe how function abstraction can be realized in C++.
6 Marks
QUESTION THREE [20 MARKS]
a). Discuss the concept of polymorphism in object oriented programming.
4 Marks
b). Briefly explain the following terms as used in inheritance:
i. Single inheritance
ii. Multiple inheritance
iii. Hierarchical inheritance
6 Marks
c). Define pure virtual functions. Write a C++ program to illustrate pure virtual functions.
10 Marks
QUESTION FOUR [20 MARKS]
a). Write a program in C++ that calculates and displays the weekly salary for an employee who
earns Kshs 2500 an hour, works 20 regular hours, 10 overtime hours, and earns time and
one-half (wage * 1.5) for overtime hours worked. Create a separate method to do the
calculation and return the result to be displayed. Your program should contain a class that
holds the employee details indicated as well as the method to do the computation
8 Marks
b). Describe the concept of inline function in C++.
3 Marks
c). Discuss the concept of message passing in object oriented programming.
2 Marks
d). Using function write a program in C++ to take two arrays of integer numbers and multiply
each corresponding values and put the result in a third array.
7 Marks
QUESTION FIVE [20 MARKS]
a) Define the term function overloading.
2 Marks
b) Explain how function calls are matched with overloaded functions.
6 Marks
c) Write a C++ program that uses function overloading to calculate and display area of circle
and rectangle using the formulas circle Area= 3.142*radius*radius and rectangle Area=
length*width.
6 Marks
d) Discuss TWO advantages of overloaded functions in C++ program.
6 Marks

(Visited 111 times, 1 visits today)
Share this:

Written by