Get premium membership and access revision papers, questions with answers as well as video lessons.

Comp 212:Object Oriented Programming December 2009 Question Paper

Comp 212:Object Oriented Programming December 2009 

Course:Bachelor Of Computer Science

Institution: Kabarak University question papers

Exam Year:2009



KABARAK UNIVERSITY UNIVERSITY EXAMINATIONS
2009/2010 ACADEMIC YEAR
FOR THE DEGREE OF BACHELOR OF COMPUTER SCIENCE
COURSE CODE: COMP 212

INSTRUCTIONS:
Section A is compulsory and has 30 marks.
Attempt any TWO questions from Section B. Each question has 20 marks.

SECTION A
QUESTION 1 (30 MARKS)
a) Write a C++ program to find the quotient of two numbers. (3 marks)
b) What is advantage of object-oriented programming technique over procedural
programming technique? (3 marks)
c) What is a stream? Briefly explain the standard input and output stream.
(3 marks)
d) As a programmer what is a Structure and how structures are declare in C++.
(3 marks)
e) Briefly explain what you understand by objects and classes in C++.(3 marks)
f) Explain the output of the following program. (3 marks)
#include <iostream>
#include <string>
using namespace std;

int main ()
{
string mystring;
mystring = "This is the initial string content";
cout << mystring << endl;
mystring = "This is a different string content";
cout << mystring << endl;
return 0;
}

g) Being the senior software developer what are the advantages of encapsulation
in OOP? (3 marks)
h) Explain what type conversion is and how to achieve this in C++. (3 marks)
i) Briefly with the help of a code explain how to access C++ class members.
(3 marks)
j) List and explain any three features of object oriented programming.(3 marks)


SECTION B
QUESTION 2 (20 MARKS):
a) Identify any four rules for defining variable names in C++. (2 marks)
b) Giving an example explain what are manipulators in C++? (2 marks)
c) Write a C++ code to show the uses of a FOR...LOOP. (2 marks)
d) Briefly explain the Object oriented paradigm. (2 marks)
e) All variables used in any program should be associated with their respective
data types. Explain any four data types used in c++. (2 marks)
f) Briefly explain how to access array elements in C++ programming.(2 marks)
g) As a young programmer write the general structure for defining a class in
C++. (4 marks)

h) What is a computer program? (2 marks)
i) Explain what are constructors in C++ programming? (2 marks)


QUESTION 3 (20 MARKS):
a) Highlight the features of functions in C++ programming. (2 marks)
b) Write a C++ program to display prime numbers between 1 and 20. (4 marks)
c) Define a Variable and with the help of a code show how to declare a variable
in C++. (2 marks)
d) With the help of a C++ code explain IF...ELSE decision statement. (4 marks)
e) Highlight the main functions of a computer program. (2 marks)
f) What is the use of comments in a C++ program? (2 marks)
g) Explain the difference between local and global variables. (4 marks)

QUESTION 4 (20 MARKS):
a) Define access specifiers listing the three main types of access specifiers in
C++ programming language. (2 marks)
b) Explain the Bitwise Operators used in C++. (4 marks)
c) As a software consultant explain the Structure of a C++ program. (4 marks)
d) Briefly explain the low-level and high level programming language (2 marks)
e) With the help of a code show how object are declared in a class. (2 marks)
f) Write a C++ program to calculate simple interest. (4 marks)

QUESTION 5 (20 MARKS):
a) Define object oriented programming. (2 marks)
b) Write a C++ program to find the product of two numbers. (2 marks)
c) Being a software consultant, State any four advantages of polymorphism?
(4 marks)
d) Briefly explain abstraction as used in C++. (2 marks)
e) What are the features of a class in C++ programming? (4 marks)
f) What are constants in C++. (2 marks)
g) Explain the difference between pass by value and pass by reference used in
C++. (4 marks)






More Question Papers


Popular Exams



Return to Question Papers