2006 Anna University B.E CSE - OBJECT ORIENTED PROGRAMMING Question Paper

Started by ganeshbala, Jul 21, 2008, 08:14 PM

Previous topic - Next topic

ganeshbala

2006 Anna University B.E computer science and engineering CS237-OBJECT ORIENTED PROGRAMMING -2 Question paper


B.E/B.Tech DEGREE EXAMINATION

[blink]CS237-OBJECT ORIENTED PROGRAMMING[/blink]

PART A

1.What is meant by data hiding.

2.Name atleast two OOPS languages other than C++.

3.How is "This pointer"useful in programming?

4.What is meant access specifier?

5.What is friend function?

6.Name the various types of multiple inheritance.

7.Is template a basic feature of C++.Justify your answer.

8.What are the classes in iostream.h header files?

9.Does Java support multiple inheritance justify your answer.

10.What is abstact class in Java?

PART B

11 (i) What is the main draw-back of structured programming? How OOP address this issue?
(ii) What are the elements of OOPS? How do these make OOPS approach best suited to address real world problems?
(iii)Briefly explain the Java runtime environment.

12(a) Explain copy constructor.
Write a program which reads a complex number and copy that into another. Use copy constructor for writing program.

(b) (i) What is the difference between register variable and automatic
Variable explain with example? What are other stroage classes for variables?
(ii)What is inline funtions? Explain with example.
What is the output of the following segment.

Void f1()
{
Int n=1;
n++;
cout<<"N:"<<
void f2()
{
Static int m=1;
M++;
Cout<<"m:"<<
#include
#include
Void main()
{
void f1();
void f2();
f1();
f2();f2();
f2();
getch();
}


13 (a) (i) Write a program which reads the bio-data and records of two
Sessional and then print final result. Make seperate class for bio-data,sessional 1, sessional 2 and final result. Sessional 1 and sessional 2 classes are derived form bio-data class. Find result in defined from sessional 1 and sessional 2 classes.

(ii) Explain the concepts identify in the program.

(b) (i) What is meant by overloading? How is operator overloading works?

(ii) Write a program to add 2 complex numbers using operator overloading. What are the operators that cannot be overloaded in C++?

14 (a) (i) Write a program which generate a template class by which one can perform integer type data addition and float type data additio also.

(ii) What is the need for and advantages of templates? What is the difference between function templates and class template?

(b) (i) What is exception handling? Explain

(ii) For handling exception what type of construct are available in C++.

(iii) Explain the concept of streams in C++ and give the hierarchy of different types of stream.

15 (a) Defines interfaces in Java. How interfaces are implemented? How they can be accessed? How to apply interfaces? What is meant by extension of interfaces? Explain with an example.

(b) (i) How is object class created in Java environment? Discuss on objects in Java.
(ii) What is meant by overloading objects? How are rested classes used in Java?

ganeshbala

2007 Anna University B.E computer science and engineering CS237—OBJECT ORIENTED PROGRAMMING Question paper

B.E/B.Tech DEGREE EXAMINATION,NOV/DEC 2005

[blink]CS237—OBJECT ORIENTED PROGRAMMING[/blink]

PART A

1.Which feature of object oriented programming provides(a) data hiding (b) reusability?

2.List any two drawbacks of procedures oriented languages.

3.What is unique about this pointer?

4.What is a default constructor?When is it used?

5.What effect does inheritance have on the working of constructors and be overloaded only by friend functions?

6.What effect does inheritance have on the working of constructors and destructors?

7.Write a function templates to swap two variables.

8.What is the differences between the statements? Cin>>ch;ch=cin.get();

9.List out any two salient differences between C++ and Java.

10.Differentiate overloading and overriding.

PART B

11. (i) Design template classes such that they support the following statements:
Rupeer1,r2;
Dollard1,d2;
d1=r2;11 converts rupee to dollar(US)

(ii) Explain the exception handling model of C++ with various constructs
Supported by it. Write a program which transfers the control to userSupported by it.Write a program which transfers the control to user defined terminate function when raised exception is uncaught.

12(a) What is object oriented paradigm? Explain the various features of Paradigm.

(b)Define the following terms related to OO paradigm:
(i) Message passing
(ii)Delegation
(iii)Genericity
(iv)Persistance

13(a)(i)Write a program for manipulating coordinates in polar coordinate system.Represent points as objects.The class polar must include data members such as radius and theta and member functions such as add(),sub(),angle()etc.

(ii)What are the rules associated in defining constructors and destructors?

(b)(i) Write a program to read a matrix of size m x n from the keyboard and display the same on the screen. Made row parameter as default argument.

(ii) Waht are(1) static(*2)constan members? Give examples to support your explanation.

14(a) Create two classes DM an DB to store the value of distances.DM stores distances in meters and centrimeters and DB in feet and inches. Write a program that can read values for the class object and add one object of DM with antother object of DB.Use a friend function to carry out the addition operation.The object that stores the results may be a Dm or DB object depending on the units in which the results are required. Tyhe display should be in ft-inches or mt-cm depending on the object of display.

(b)Write a C++ program to model the following inheritance hierarchy.


15.(a)Define an interface that declares the methods count and print for a collection of items. Define another interface that declares a method to search for an item. Define a class integer collection to represent a collection of integers and provide methods to count the number of items,print the number of items, search for an item and find the sum of all integers int the collection. Define another class string set that implements all the methods defined in both these interfaces on a collections of strings. Write a test program to test these classes.

or

(b) (i) How are abstact classes different from interfaces?
(ii) Create a class to model entries in a telephone directory (name address,phone,number).Define suitable classes and inheritance hierarchy.Write a program to test these classes.

prasannababu

Quote from: ganeshbala on Jul 21, 2008, 08:16 PM
2007 Anna University B.E computer science and engineering CS237—OBJECT ORIENTED PROGRAMMING Question paper

B.E/B.Tech DEGREE EXAMINATION,NOV/DEC 2005

[blink]CS237—OBJECT ORIENTED PROGRAMMING[/blink]

PART A

1.Which feature of object oriented programming provides(a) data hiding (b) reusability?

2.List any two drawbacks of procedures oriented languages.

3.What is unique about this pointer?

4.What is a default constructor?When is it used?

5.What effect does inheritance have on the working of constructors and be overloaded only by friend functions?

6.What effect does inheritance have on the working of constructors and destructors?

7.Write a function templates to swap two variables.

8.What is the differences between the statements? Cin>>ch;ch=cin.get();

9.List out any two salient differences between C++ and Java.

10.Differentiate overloading and overriding.

PART B

11. (i) Design template classes such that they support the following statements:
Rupeer1,r2;
Dollard1,d2;
d1=r2;11 converts rupee to dollar(US)

(ii) Explain the exception handling model of C++ with various constructs
Supported by it. Write a program which transfers the control to userSupported by it.Write a program which transfers the control to user defined terminate function when raised exception is uncaught.

12(a) What is object oriented paradigm? Explain the various features of Paradigm.

(b)Define the following terms related to OO paradigm:
(i) Message passing
(ii)Delegation
(iii)Genericity
(iv)Persistance

13(a)(i)Write a program for manipulating coordinates in polar coordinate system.Represent points as objects.The class polar must include data members such as radius and theta and member functions such as add(),sub(),angle()etc.

(ii)What are the rules associated in defining constructors and destructors?

(b)(i) Write a program to read a matrix of size m x n from the keyboard and display the same on the screen. Made row parameter as default argument.

(ii) Waht are(1) static(*2)constan members? Give examples to support your explanation.

14(a) Create two classes DM an DB to store the value of distances.DM stores distances in meters and centrimeters and DB in feet and inches. Write a program that can read values for the class object and add one object of DM with antother object of DB.Use a friend function to carry out the addition operation.The object that stores the results may be a Dm or DB object depending on the units in which the results are required. Tyhe display should be in ft-inches or mt-cm depending on the object of display.

(b)Write a C++ program to model the following inheritance hierarchy.


15.(a)Define an interface that declares the methods count and print for a collection of items. Define another interface that declares a method to search for an item. Define a class integer collection to represent a collection of integers and provide methods to count the number of items,print the number of items, search for an item and find the sum of all integers int the collection. Define another class string set that implements all the methods defined in both these interfaces on a collections of strings. Write a test program to test these classes.

or

(b) (i) How are abstact classes different from interfaces?
(ii) Create a class to model entries in a telephone directory (name address,phone,number).Define suitable classes and inheritance hierarchy.Write a program to test these classes.