Vous êtes sur la page 1sur 2

www.Vidyarthiplus.

com
Reg. No. :

Question Paper Code : 53109

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 Answer ALL questions PART A (10 2 = 20 Marks) 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. With respect to C++ distinguish objects from classes.

Write a copy constructor for class date (assume mm, dd, yy as its members). What is encapsulation? Do friend functions violate encapsulation? How are virtual functions declared in C++? What are IO streams? Give an example.

What is the purpose of the STL (Standard Template Library)? Give two examples for java modifiers.

What is the purpose of the getBytes( ) method? Give a sample statement for parseInt( ) and give comments for the statement. What are the two ways of creating java threads? PART B (5 16 = 80 Marks)

11.

(a)

21
(b)

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 Explain the features of object oriented programming. Describe how each of these is implemented in C++ and Java.

www.Vidyarthiplus.com

21

Maximum : 100 Marks

21

www.Vidyarthiplus.com
12. (a) Write a C++ program as follows to perform arithmetic operations on Rational numbers of type a/b, where a and b are integers. (i) (ii) Define a class by Rational Number.

Use operator overloaded methods for addition and subtraction.

(iii) Write a main program to demonstrate the use of this class and its methods. (4) (iv) Give a sample output. Or (b) (2)

What is meant by inheritance? Explain with examples, the various types of inheritance supported in C ++. Write a C++ program to demonstrate file handling as follows: get strings as input from the user, store them in a file, retrieve them and display them. Or

13.

(a)

(b)

Explain the exception handling mechanism available in C++ with suitable examples. Write a menu-based java program that can calculate the area of a triangle, circle or square, based on the users choice. Or

14.

(a)

(b) 15. (a)

Explain the Virtual Machine concept with reference to Java. Write a java class called student with name, Marks of 3 subjects and total Marks. Write another class named calculate that gets the Marks of the student and calculates the total Marks and displays the result (pass or fail).

(b)

Explain the following with examples from Java. (i) (ii) Streams and IO Java threads.

4
Or 2

21

21

www.Vidyarthiplus.com

21
(4) (6) (2 8 =16)

53109

Vous aimerez peut-être aussi