0% found this document useful (0 votes)
39 views

Cs 237 - Object Oriented Programming: PART - A (10 X 2 20 Marks)

The document describes the questions that will be asked in an object oriented programming exam. It has two parts: Part A contains 10 short answer questions about OOP concepts like data and function organization in classes, function overloading, references, dynamic binding, access specifiers, function templates, this pointer, copy constructors, and constructor vs operator conversion. Part B contains 5 long answer questions about OOP principles like encapsulation, inheritance and polymorphism. It also asks to create classes for complex numbers, strings, shapes, exceptions, dates and nested geometric classes to demonstrate OOP concepts.

Uploaded by

Muhammad Saleem
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

Cs 237 - Object Oriented Programming: PART - A (10 X 2 20 Marks)

The document describes the questions that will be asked in an object oriented programming exam. It has two parts: Part A contains 10 short answer questions about OOP concepts like data and function organization in classes, function overloading, references, dynamic binding, access specifiers, function templates, this pointer, copy constructors, and constructor vs operator conversion. Part B contains 5 long answer questions about OOP principles like encapsulation, inheritance and polymorphism. It also asks to create classes for complex numbers, strings, shapes, exceptions, dates and nested geometric classes to demonstrate OOP concepts.

Uploaded by

Muhammad Saleem
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 2

CS 237 - OBJECT ORIENTED PROGRAMMING

Time: 3hrs Max Marks: 100

Answer all Questions

PART - A (10 x 2 = 20 Marks)


1. 2. 3. 4. 5. 6. 7. 8. 9. 10. How are data and functions organised in an object oriented programming? Compare function overloading and default arguments. What are the uses of references in functions? What is dynamic binding? Compare private and public access specifiers in a class. Distinguish between overloaded functions and function templates. What is this pointer? How is it available to member functions of a class? Can the parameter of a copy constructor be passed by value? Justify your answer. Compare constructor conversion and operator conversion. What is the difference between system . out . print and system . out . println in Java?

PART - B (5 x 16 = 80 Marks)
11. Explain in detail the following principles of object oriented programming (i) (ii) (iii) Data encapsulation and data hiding Inheritance and polymorphism Generic programming.

12.a) Create a class complex to represent complex number with overloaded addition and multiplication operators. Use them in a main program. (OR) 12.b) Define a class string with appropriate constructors, destructor and overloaded +, =, and = = operators use them in a main driver program. 13.a) What are the different forms of inheritance? Give example for them. (OR) 13.b) Create an abstract base class shape with two members base and height, a member function for initialization and a pure virtual function to compute area ( ). Derive two specific classes Triangle and Rectangle which override the function area ( ). Use these classes in a main function and display the area of a triangle and a rectangle. 14.a) Write a C++ program containing a possible exception. Use a try block to throw it and a catch block to handle it properly. (OR) 14.b) Create a data class using Java with the following capabilities. Out the date in multiple format such as (i) dd - mm - yy

(ii)

June 14, 2002.

15.a) Write a Java class point to represent a two dimensional point (x, y). Extend it to a class circle with its centre as the point and an additional radius member and extend further to a class cylinder with additional height member. (OR) 15.b) Explain the concept of nested classes in Java with a suitable example.

You might also like