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

Comp 212:Object Oriented Programming With C++ April 2011 Question Paper

Comp 212:Object Oriented Programming With C++ April 2011 

Course:Bachelor Of Education Science

Institution: Kabarak University question papers

Exam Year:2011



KABARAK UNIVERSITY
UNIVERSITY EXAMINATIONS
2010/2011 ACADEMIC YEAR
FOR THE DEGREE OF BACHELOR OF EDUCATION SCIENCE

COURSE CODE: COMP 212
INSTRUCTIONS:
1. Section A is compulsory and has 30 marks.
2. Attempt any TWO questions from Section B. Each question has 20 marks.
SECTION A
QUESTION 1 (30 MARKS)
a) Being a programmer write a C++ program to find the area of a circle; the variables
should be inserted from the keyboard by the user. (5 marks)
b) As a software developer, variable names have several naming rules and one has to abide to
them. Identify any five of these rules. (5 marks)
c) In your own understanding how would you explain encapsulation and polymorphism
as used in C++. (5 marks)
d) Functions play a very important role in any program. Explain what a function is and
how to define and call a function. (5 marks)
e) Explain in detail the fundamental parts of the basic structure of any C++ program.
(5 marks)
f) What is a stream? Briefly explain the standard input and output stream.
(5 marks)


SECTION B
QUESTION 2 (20 MARKS)
a) What is a Manipulator? Explain any three types of C++ manipulators.
(4 marks)
b) Write a C++ program explain how the SWITCH statement is used in C++.
(4 marks)
c) Highlight the main Functions of a computer program.
(4 marks)
d) Differentiate between High level and low level programming language.
(4 marks)
e) What is a pointer? Explain with code examples how to define Pointer Variables in
C++. (4 marks)

QUESTION 3 (20 MARKS)
a) What is an access specifier? Explain three main types of access specifiers used in C++
programming language. (4 marks)
b) Write a C++ program explain how the WHILE LOOP is used. (4 marks)
c) List any four qualities that in order to qualify as an algorithm, a sequence of instructions
must possess. (4 marks)
d) Most programmers love using functions, being one of them explain the scope of
variables as used in C++ functions. (4 marks)
e) Explain the difference between pass by value and pass by reference used in C++.
(4 marks)

QUESTION 4 (20 MARKS)
a) Write short notes on the following (4 marks)
(i) Low-level programming language.
(ii) High level programming language.
b) You have been employed as a programmer. Write a C++ program to help the accountant
calculate simple interest. (4 marks)

c) What is an array? Show how an array is declared in C++ Programs. (4 marks)
d) With the help of a C++ code explain IF...ELSE decision statement. (4 marks)
e) Explain what type conversion is and how it is achieved in C++. (4 marks)

QUESTION 5 (20 MARKS)
a) As a software expert what is a storage class? Explain the three types of storage
classes used in C++. (4 marks)
b) Write a C++ program to add the elements of a 3x3 matrix. (4 marks)
c) Explain constructors and destructors as used in C++. (4 marks)
d) It is always a good practice to use comments in your program. With the help of a
C++ code example explain the two ways on how comments can be implemented in
any program. (4 marks)
e) Briefly explain what you understand by objects and classes in C++.
(4 marks)






More Question Papers


Popular Exams



Return to Question Papers