Showing posts with label Question Papers. Show all posts
Showing posts with label Question Papers. Show all posts

B.E/B.Tech Computer Science Engineering | OBJECT ORIENTED PROGRAMMING | Old Question Paper 3

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:”<<<<”m:”<<
#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?

B.E/B.Tech Computer Science Engineering | OBJECT ORIENTED PROGRAMMING | Old Question Paper 2


PART A

1.Why is OOP methodology considered to be the better approach for real life problems?
2.What are the use of pointers in C++?
3.How do objects interact?
4.What is the differences between a constructor and destructor?
5.Give atleast two examples of compile time polymorphism.
6.Why is the derived class constructor called before the base class
Constructor?
7.Give the syntax of declaring a function template.
8.What are input and ouput streams?
9.What are the three kinds of class members?
10.What is meant by member access modifiers?

PART B

11 (i) Write a program that generates a template class by which one can perform integer type data addition and float type data addition also.
(ii) How are unusaul error conditions avoider using C++?
12(a) What are the elements of object oriented programming? Discuss them in detail.
(b) What are the various data types allowed in C++? Give one example for each type.
13 (a) (i) Using the concept of function overloading,write a program in C++ to find the maximum of three integers and three float numbers
(ii) Which are the C++ operators which cannot be overloaded.
14.(a) (i) Write a program which initialised 10 and 200 to member data and then calculate the sum of these.
(ii) Write a program which reads a complex number copy that into another. Use copy constructor for writing program.
(b) (i) What is the function of this pointers?
(ii) What do you understand by static member and static function? How to declare them?
15.(a) (i) Specify the accesss modifiers of the class members.
(ii) Give the general form of an interface and how is it implemented.
(b) (i) Give two parts of method declaration. How is a static method invoked? When will the method complete execution and return to the caller? How will methods return more than one result?
(ii) Write a program to compute the volume of a box.

B.E/B.Tech Computer Science Engineering | OBJECT ORIENTED PROGRAMMING | Old Question Paper 1


PART A

1.Differentiate Object Oriented Object Based Programming Langauages.
2.Comment on the following overloaded function
Void inc(int i)
{
i=i+1;
}
Void inc(int i, int diff =1)
{
i=i+diff;
}
3.What is the ouput of the following program?
#include
main()
{
int i=3,j=5;
double x=33.5,y=10.0;
cout<<10+j%1<<”\n”;
cout<<<”\n”;
cout<<(19+i+j)/(2*j+2)<<”\n”);
cout<<<”\n”;
cout<<<”\n;
}
4.What is error in the following class declarations?
Class string{
Char *str;
Unsigned len;
String();
String(string& s);
String(unsigned size char = ‘ ‘);
String(unsigned size);
String & assign (Strong& s);
~String();
Unsigned getlen() const;
Char * getString();
}
5.Differentiate Overloaded and overriden funcions.
6.Consider the following program
Class fun
{
Public:
fun(void)
{
Cout<<”1”;}
fun(fun &x)
{ cout<<”2”;}
fun operator-(fun y)
{ fun test; return(test); }
};
If the function main is coded as fun a,b; what is its output?
7.What is the main purpose of a template in C++? Give an example.
8.Give any two examples of expressions.
9.Differentiate instance members and static members.
10. In java, Can a class be defined inside a method? If so,what rule governs access to the variables of the enclosing method? If not, give reasons.

PART B
11 (i) Define a class Counter to model a counter in its general form, Define classes to model special forms like Cyclic counter,down counter and step 2 down counter. Provide methods for the following opeations-step,display,reset.Write a JAVA program to test the classes

(ii)Differentiate abstract classes and interfaces.
12(a) Explain the following characteristics of object oriented programming with examples.
(i) Data Encapsulation
(ii) Polymorphism
(iii) Genericity
(iv) Inheritance.
13(a) (i) What are the characteristics of constructor functions? Describe various of constructors with examples.
(ii) Create a class that keeps track of its number of instances.
(b) Define a C++ class Matrix to describe a matrix.Equip the class with functions for addition and multiplication.Overload operators suitably for input and output of the matrix.
14 (a) (i) What are friends functions? Give an example to highlight its need? What is its limitations?
(ii)What are virtual functions? Give an example to highlight its need?
(b) Give an applications that fits the following inheritance hierarchy and write the program for the same. Each class should have atleast two data members and two functions members.
15.(a) Give the syntax of functions template.Write template functions for bubble sort.Write a test program to illustrate its use.
(b) (i) Give the hierarchy of console stream classes.
(ii) Explain how exceptions are handled in C++, Give examples to support your answer.

Note : Dear friends this is an Old Question Paper of Anna University Computer Engineering Department. Though the new pattern comes with so many updations, it also may be useful for you.