Você está na página 1de 7

B.E./B.Tech.

DEGREE EXAMINATION, NOVEMBER/DECEMBER 2010 Fifth Semester Electrical and Electronics Engineering CS 2311 OBJECT ORIENTED PROGRAMMING (Common to Instrumentation and Control Engineering and Electronics and Instrumentation Engineering) (Regulation 2008) Time : Three hours Maximum : 100 Marks Answer ALL questions PART A (10 2 = 20 Marks) 1. With respect to C++ distinguish 'objects' from 'classes'. 2. Write a copy constructor for class date (assume mm, dd, yy as its members). 3. What is encapsulation? Do friend functions violate encapsulation? 4. How are virtual functions declared in C++? 5. What are IO streams? Give an example. 6. What is the purpose of the STL (Standard Template Library)? 7. Give two examples for java modifiers. 8. What is the purpose of the getBytes( ) method? 9. Give a sample statement for parseInt( ) and give comments for the statement. 10. What are the two ways of creating java threads? PART B (5 16 = 80 Marks) 11. (a) Write a C++ program to perform 2D matrix operations as follows: (i) Define class MATRIX, use appropriate constructor(s). (5) (ii) Define methods for the following two matrix operations: determinant and transpose. (6) (iii) Write a main program to demonstrate the use of the MATRIX class and its methods. (5) Or (b) Explain the features of object oriented programming. Describe how each of these is implemented in C++ and Java.

CS1204 OBJECT ORIENTED PROGRAMMING Question Papers

ANNA UNIVERSITY- COMBATORE B.E./ B.TECH. DEGREE EXAMINATION - JUNE 2009. ELECTRICAL & ELECTONICS ENGG. - FOURTH SEMESTER OBJECT ORIENTED PROGRAMMING Question Papers

PART-A Answer all questions. (20*2=40) 1. What is object oriented programming ? How is it different from the procedure oriented programming? 2. How is dynamic binding achieved in c++. 3. With an example explain an abstract data type. 4. What is the purpose of malloc and free operators. 5. what is the default access mode for class members. 6. State the mechanism of passing objects to a function. 7. How does a constructor differ from a normal function. 8. State why a destructor is used when developing an application in c++. 9. What are the limitations of multiple inheritance. 10. Justify the need for virtual functions in c++. 11. What are the advantages of abstract classes. 12. List the operators that cannot be overloaded in C++. 13. Compare the important features of c++ and Java. 14. Define JVM. 15. List the four integer types supported by Java. 16. Distinguish between overloading and overriding. 17. List the four categories of visibility addressed by Java for class members. 18. What is the major difference between interfaces and classes. 19. What is a package. 20. Discuss the package access protection

PART-B Answer any five. (5*12=60) 1. a) Discuss the non-object oriented features of c++ with programmng examples. (8) b) State the merits and demerits of object oriented methodology. (4) 2. a) Explain copy constructor with suitable c++ coding. (8) b) What are the differences between default and

parameterized constructors. (4) 3. With relevant examples discuss the different types of inheritance supported by c++. (12) 4. a) Write a c++ program to overload the assignment operator. (8) b) List out the rules for overloading operators. (4) 5. a) Explain method overloading with suitable Java coding. (8) b) Does Java support multiple inheritance?. Discuss. (4) 6. Write a Java program to create the class Rectangle and Square. Compute their area and compare the areas. List the features of OOP used and explain them. (12) 7. Explain the various forms of inheritance implementation. (12) 8. What is the purpose of using packages? How do you create user-defined package? Give an example. (12)

SUBJECT: CS2311 OBJECT ORIENTED PROGRAMMING UNIT-I PART A 1.Write the difference between oop and pop 2.What are the benefits of oop? 3.What are the various applications of oop? 4.What is a Datatype? 5.Define typecast operator 6.What do u meant by inline functions? 7.Write a simple c++ pgm to swap two nos without using temp variables 8.What is the difference between return by reference and call by reference? 9.What is function prototyping? 10.What do you meant by reference variable? PART-B

1.Illustrate the function overloading concept with a C++ program to find the volume of cube and cylinder 2.Explain the basic concepts of oops with suitable Examples 3.Write a C++ program to construct student mark list for three subjects. Write the pgm to display name,rollno,marks,avg and total.Use clss and objects. 4.Explain the control structures in C++ 5.Define Call by reference and Return by reference. UNIT-2 PART-A 1.What is general form of class declaration? 2.What are the two ways of defining a method? 3.Define static data members and static member functions. 4.What is a Friend function? 5.What is constructor and destructor?What are the types of constructor? 6.Why there is a need to have private member functions? 7.Define about arrays within a class 8.What is the need of scope resolution operator? PART-B 1.Explain the Friend function concept with an example program. 2.What is Dynamic Initialisation of objects?Give a program to illustrate your answer. 3.Explain the constructor concept with its types with example programs. 4.Explain the concept of objects as functional arguments. 5.Write a C++ program to manage a bank account using classes and objects. UNIT-3

PART-A 1.What is operator overloading? 2.State the rules of operator overloading. 3.Define Inheritance and its types 4.What is this pointer? 5.Define abstract class 6.Explain the different visibility or access modifiers? 7.Define polymorphism. 8.What is Virtual function? 9.What are the operators that cannot be overloaded? 10.What is the difference between virtual functions and virtual classes? PART-B 1.Explain virtual function concept with a program to find the distance between two objects. 2.Explain the Inheritance types with example programs for last three types. 3.What do u meant by operator overloading?what are its types?Explain the types with eg programs. 4.Expalin single and multiple Inheritance with an example of your own. 5.Describe manipulation of strings with overloading the following operators:<<,>>,+,UNIT-4 PART-A 1.How java differs from C++? 2.What are command Line arguments? 3.Define Java virtual machine concept. 4.What are the different Java tokens and statements? 5.What is a Final Class?

6.Illustrate the syntax of array in Java. 7.Write a simple Java program 8.What are the input and output statements in Java? 9.Expalin vectors in java 10.What is method overriding PART-B 1.Explain Method overriding in Java with an eg. 2.Construct the pictorial representation of Java Virtual Machine. 3.Write a program in java using constructor concept. 4.What are the different statements and its use in java? 5.Illustrate Inheritance in Java with suitable program. 6.Give a explanatory answer to define the difference between Java and C++,Characteristics of Java and the concepts in java UNIT-5 PART-A 1.What is an Interface and how will you extend it? 2.Define package concept 3.What are the different errors 4.What is the difference between error and exception? 5.What is a thread?What are the different state sin its life cycle? 6.What is Multithreading? 7.Define Applet 8.Write an applet program to design a web page? 9.What is Thread priority?

10.What are the different types of Thread? 11.How will you run the applet? 12.What is the difference between application and applet program?

PART-B 1.Explain the Life cycle of Thread with an eg 2.Describe package concept to perform arithmetic operations.Explain how to use it? 3.Explain the different states in Life cycle of applet? 4.Define Interfaces?Explain the extension of interfaces,implementation and accessing it. 5.What are the Different Exceptions caught,Explain the types with eg program. 6.Explain try, catch and finally statements with eg.

Você também pode gostar