Third Semester(Regulation 2004)Computer Science and EngineeringCS 1204—OBJECT ORIENTED PROGRAMMING(Common to Information Technology )(Common to BE (Part-Time) Second Semester Regulation 2005)
Time : Three hours Maximum : 100 marks
Answer ALL questions
PART A—(10 x 2 = 20 marks)
1. What is object oriented paradigm?2. What is the use of scope resolution operator : : in C++?3. What are the operators of C++ that cannot be overloaded?4. How does constructor differ from normal functions?5. What is the default access mode for class members?6. What is an I/O stream?7. What is the type of class for which objects cannot be created?8. What is type of inheritance is supported in Java?9. What is java virtual machine?10. What is multithreading?
PART B—(5 x 16 = 80 marks)11. (a) (i) Explain object oriented paradigm with all its essential elements. (12)(ii) State the merits and demerits of object oriented methodology. (4)
Or
(b) Explain the following concepts of object oriented programming in detail (i). Data abstraction(ii). Inheritance(iii). Polymorphism(iv). Objects
12. (a) (i) Write a C++ program to extract the elements placed in the odd position of the array. (8)
(ii) State the rules to the followed while overloading an operator. Write a program to illustrate overloading. (8)
Or
(b) (i) Discuss about polymorphism and its advantages. (8)
(ii) Write a C++ program that will give the conditions of environment required, food habits and unique characteristics of pet animals fish and dog. Define a base class called pet that describe any common household pet; two derived classes called fish and dog with items specific to that type of animal. Write pure virtual functions in the base class for operations that are common to both types of animals. Write a program to test the usage of classes. (8)
13. (a) (i) Explain the 4 functions Seekg, Seekp, tellg, tellp used for setting pointers during file operation and show how they are derived from fstream class. (4)
(ii) Write a program to append to the contents of a file. (10)
Or
(b) (i) Write a program to write the text in a file. Display the contents of file in reverse order. (8)
(ii) What are the keywords used in C++ for exception handling?Describe their usage with suitable example. (8)
14. (a) (i) Explain the interface concepts in Java. (8) (ii) Write a Java program to compute the area of rectangle and square using interface. (8)
Or
(b) (i) Compare the features of C++ versus Java. (6)
(ii) Give an example that fits the following inheritance hierarchy. (10)
Write a Java program to implement this example.
15. (a) Explain about exception handling in Java with suitable examples. (16)
Or
(b) What is a thread? State how synchronization is dealt while using multithreading. (16)
Monday, June 23, 2008
Subscribe to:
Posts (Atom)