Oop Cat 1

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

JOMO KENYATTA UNIVERSITY OF AGRICULTURE AND TECHNOLOGY

UNIVERSITY EXAMINATIONS 2023/2024


OBJECT ORIENTED PROGRAMMING CAT 1
DATE: MARCH 2024 TIME: 1 HOUR(S)
INSTRUCTIONS: ANSWER ALL QUESTIONS [30 MARKS]
=============================================================================
(a) Distinguish between the following terms:
(i) Objects and classes [6 marks]
(ii) Data abstraction and data encapsulation [6 marks]
(iii) Dynamic binding and message passing [6 marks]
(b) Below is a simple C++ code, explain code and give its outcome
#include<10stream>
Using namespace std;
Int foo[]={16, 2, 77, 40, 12071}:
Int n, result=0;
Int main ()
{
For (n=0; n<5; n++)
{
Result +=foo[n];
}
Cout<<result;
Return 0;
} [8marks]

(c) List any four areas where OOPs are applicable (4marks)
(d) List three data type used in programming and show how each can be used in a
program by use of examples (6marks)

You might also like