0% found this document useful (0 votes)
90 views3 pages

Ics 2104 Object Oriented Programming I

object orientation one
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)
90 views3 pages

Ics 2104 Object Oriented Programming I

object orientation one
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/ 3

W1-2-60-1-6

JOMO KENYATTA UNIVERSITY OF AGRICULTURE AND


TECHNOLOGY
UNIVERSITY EXAMINATIONS 2014/2015
FIRST YEAR SECOND SEMESTER EXAMINATION FOR THE DEGREE
OF BACHELOR OF BUSINESS INFORMATION TECHNOLOGY

ICS 2104 : OBJECT ORIENTED PROGRAMMING I

DATE: DECEMBER 2014 TIME: 2 HOURS


INSTRUCTIONS: ANSWER QUESTION ONE AND ANY OTHER TWO
QUESTIONS
==========================================================
QUESTION ONE [30 MARKS]
(a) Explain the properties of constructors and distracters
[6 marks]
(b) Define exception handling. Explain types of
exception handling using suitable example. [6 marks]
(c) Write a C++ program that ask the user for
temperature in antigrade and the output the equivalent
faren height use a decli………………..[5 marks]
(d) Explain the difference between pointer variable and
pointer constant. Explain with relevant code [5 marks]
(e) Describe the function of the following functions [8
marks]
(i) Seekg( )
(ii) Seekp ( )
(iii) Tellg ( )
(iv) Tillp ( )

QUESTION TWO [20 MARKS]


(a) Explain the following object –oriented concept [8
marks]
(i) Abstraction
(ii) Encapsulation
(iii) Over loading
(iv) Message passing
(b) Explain the difference between static 8 dynamic
binding [4 marks]
(c) Write a C++ program that make use of three classical
namely [8 marks]
(i) Class student – which capture student details and
admission number
(ii) Class test-which inherit from class student and
additionally captures and displays marks in two
subjects
(iii) Class result inherits from class test and additionally
calculate and displays the average and student mark.

QUESTION THREE
(a) Explain the purpose of the following concept in object
oriented programming
(i) Ambiguity resolution
(ii) Virtual base class
(iii) File pointer
(b) Explain the error in the following C++ CODE [3
marks]

Double max (double a , double b )


{
return a, 2b ? a:b;
}
double max (int a, int b)
{
return a>b? a:b;

}
Int main (void)
{
Cout<<max (1,2.2):
}

(c) Outline the process of writing a file [3 marks]


(d) Write a C++ program to determine if a person is
eligible for driving license if above 18 year [4 marks]
(e) Explain the benefits of object oriented programming
[4 marks]

QUESTION FOUR [20 MARKS]


(a) Explain the different forms of inheritance [6 marks]
(b) Write a C++ program that allows the user to input a
number and checks if the number is even or odd [6 marks]
(c) Define the following term as used in object oriented
programming [8
marks]
(i) Object
(ii) Classes
(iii) Abstract classes
(iv) Identifiers

QUESTION FIVE
(a) Explain public, private and protected access specifiers
and show their visibili9ty when they are inherited as public,
private and protected [8 marks]
(b) Explain the following terms [3 marks]
(i) Iostream
(ii) Ifstream
(iii) Fstrasm
(c) Outline the benefits of data abstraction [4 marks]
(d) Describe the following type of program execution [4
marks]

You might also like