You are on page 1of 3

Computer science and Engineering CS220 !

O"#ect Oriented $rogramming


MO%EL E&AM ' I (Slow Learners)
Time* T+ree +ours Ma,imum * -00 Mar.s

THIRUMALAI ENGINEERING COLLEGE SET !

Ans/er ALL 0uestions $ART A!(-0 , 2 120 mar.s) 1. What is difference between the class and structure? 2. State the advantage of new and delete over malloc() and free() function. 3. What is the need for initialization of objects using constructors? . What is a !estructor? ". What is a #em$late? What are their advantages? %. What is &throw' ()? What is use? (. What is inheritance? What are t)$es of inheritance? *. What is meant b) abstract class? +. What are streams? Wh) the) are useful? 1,.What is a names$ace?

PART B-(5x16=80 marks)


11. (a)-.$lain the $rinci$les of object oriented $rogramming with illustrative e.am$les(1%) (/r) (b)(i)What is function overloading? -.$lain with an e.am$le $rogram.(1,) (ii)What is friend function? -.$lain with an -.am$le. (%) 12.(a)What are the various t)$e of constructors? 0llustrate with -.am$le $rograms.(1%) (/r) (b) !efine a class called com$le.. 0nclude function for reading and dis$la)ing com$le. objects. Write a function to overload 1/$erator to add two 2om$le. objects (1%) 13.(a) Write a $rogram for binar) search as a generic function .#he function should ta3e arguments as arra) name the size and element to be searched.(1%) (/r) (b) !iscuss in detail e.ce$tion handling constructs in 211. Write a $rogram to illustrate divide b) zero e.ce$tion handling.(1%) 1 .(a) -.$lain the major $rinci$les of object oriented $rogramming with illustrations and neat s3etches (1%) (Or) (b) -.$lain in detail about (1%)

a. 0nline function b. 4riend function c. 2onst function d. 5olatile function with suitable illustrations 1".(a) What are the various t)$es of constructors? 0llustrate with $rogramming e.am$les. (Or) (b) What is meant b) function overloading? Write a 211 $rogram to illustrate the conce$t of function overloading. (1%)

Computer science and Engineering CS220 !O"#ect Oriented $rogramming


MO%EL E&AM ' I (Slow Learners)
Time* T+ree +ours

THIRUMALAI ENGINEERING COLLEGE SET !

Ma,imum * -00 Mar.s Ans/er ALL 0uestions $ART A!(-0 , 2 120 mar.s) 1. What 2. What 3. What . What ". What %. What (. What *. What +. What 1,.What are objects? 0llustrate with an e.am$le? is data abstraction? is a constructor? are new and delete o$erators? is a #em$late? is a e.ce$tion? is the use of abstract base class? is $ure virtual function? are the wa)s of using names$ace? are mani$ulators?

PART B-(5x16=80 marks)


11.(a) What is a function tem$late? Write a tem$late function to sort arra)s of float and int using bubble sort. (1%) (Or) (b) !iscuss in detail about e.ce$tion 6andling constructs and write a $rogram to illustrate divide b) zero e.ce$tion. (1%) 12.(a) -.$lain with the $rogram various t)$es of #)$e 2onversion.(1%) (Or) (b) -.$lain the $rinci$les of object oriented $rogramming with illustrative e.am$les(1%) 13.(a) (i) 7ive the 8ules for writing virtual functions.(%) (a) (ii) Write a 211 9rogram to 0llustrate the use of virtual function(1,) (Or) (b)!ifferent t)$es of inheritance with -.am$le $rogram(1%) 1 .(a) What is a$$lication of virtual function? -.$lain with an -.am$le how late binding is achieved using virtual function.(1%) (Or) (b) -.$lain the various runtime casting in detail. (1%) 1".(a) What are mani$ulators? -.$lain in detail various mani$ulators used for 0:/ o$erations with e.am$le.

(b)what is virtual function and $ure virtual function with $rogram(1%)

You might also like