Monday, March 7, 2016

CS274 - Object Oriented Programming April May 2014

Anna University Question CS274 Object Oriented Programming April May 2014, Computer Science and Engineering, Third Semester, Regulation 2004

Academic Year
April May 2014
Subject Code
CS 274
Subject Name
Object Oriented Programming
Computer Science and Engineering
Third Semester

Computer Science and Engineering
Third Semester
(Regulation 2004)
Time : 3 Hours                      Answer A L L Questions                Max. Marks 100
PART-A (10 x 2 = 20 Marks)

1. Write four advantages of object-oriented approach over traditional approach?
2. Can constructors and destructors be overloaded? Justify.
3. Define ADT.
4. What is the use of “this” pointer? Illustrate.
5. What are inline functions? Give an example.
6. Define friend functions. Does friend function violate encapsulation?
7. Differentiate function template and template function.
8. What is meant by STL?
9. What is a Virtual Class? Why it is used in C++?
10. Differentiate throw and throws.

Part-B (5* 16 = 80 Marks)
11. A) Write a program in C++ to create a Class "Student" with data members Roll No, Name, Course, Branch, and Semester. Store them in an array of objects. Input the total number of students and perform the following operations,
i. Sorted list of students in the ascending order of name. (8)
ii. Branch wise student name list (8)
12. A) Create two Classes ABC and XYZ which stores the values of distances in meters/centimeters and Feet/inches respectively. Write a program that can read the values of Class Objects and add one Object of ABC with another Object of XYZ. Use friend function to carry out this operation. The display should be in the form of meters/centimeters and Feet/Inches depending on the object on display. (16)
B) Write a Program in C ++ to perform arithmetic operations on rational numbers 'a/b' where 'a' and 'b' are integers for the following.
i. Define a class by rational numbers (5)
ii. Use pointer operators for addition and subtraction. (5)
iii. Write a main program to demonstrate 'this pointer' and call its value by using its method. (6)

13. A) Write a program in C++ to implement overloaded constructor to perform String initialization. String copy and String destruction. (16)
B) Write a program in C++ to implement C = A + B, C = A - B and C = A * B where A, B and C contains 'int' value (Vector). (16)

14. A) What is template function? Design and implement a template version of min() and max() for finding the maximum value and minimum values of given set of elements of list T represented by seqlist <T> object. (16)
B) Write a program C++ that reads a name from keyboard into three separate String Objects and Concatenates them into a new String object using '+' operator and append ( ) . (16)

15. A. Describe the role of Pass by Value and Pass by Reference with an example. Write a program that has possible exceptions of your own choice. Use a try block and throw to catch the exception using another block. (16)
B) i. Explain the usage of inheritance and the types of inheritance with an example. (8)
ii. With suitable example illustrate the use exception handling in C++ (8)


Featured Content

Multiple choice questions in Natural Language Processing Home

MCQ in Natural Language Processing, Quiz questions with answers in NLP, Top interview questions in NLP with answers Multiple Choice Que...

All time most popular contents

data recovery