CU SEC-A-2 Object Oriented Programming in C++, 2021
University of Calcutta question paper, B.Sc. Honours Semester III, 2021. Object Oriented Programming in C++. Typed in LaTeX, searchable, with a printable PDF.
Open this paper in MathQP
- float (ii) string (iii) character (iv) integer.
- 2 (ii) 1 (iii) 4 (iv) 0 .
- virtual (ii) inline (iii) static (iv) void.
- Abstraction (ii) Encapsulation (iii) Polymorphism (iv) Modularity.
- How to access the private member function of a class?
- Which of the following is not a type of constructor?
- Which statement gets affected when i++ is changed to ++i ?
- 0 (ii) 11 (iii) unpredictable (iv) error.
- * (ii) = (iii) ++ (iv) - .
- A template class
- What is object-oriented programming? Distinguish between data abstraction and data encapsulation in object-oriented programming.
- Write a C++ program to calculate the variance and standard deviation of N numbers. Use the formula Mean = bar x = dfrac 1 N sum i=1 N x i ; Variance = dfrac 1 N sum i=0 N (x i - bar x ) 2 , Standard Deviation = sqrt dfrac 1 N sum i=0 N (x i - bar x ) 2
- Write 5 differences between C and C++.
- Write a C++ program swapping two numbers using pointers.
- Define an array. Explain types of arrays with example.
- What is the difference between pointers to constants and constant pointers? Give examples.
- Explain enumeration data type with an example.
- Write a C++ program to set number of precision points. Display the results of sqrt 7 in different precision settings from precession 10 to 1 .
- Write a C++ program to find the octal representation of a given positive number.
- List out the types of Inheritance. Discuss in detail about any two Inheritance concepts with an example program.
- What is polymorphism? Explain different types of polymorphism.
- What is friend function and friend class and what are the merits and demerits?
- Write a C++ program to implement binary operator overloading over ‘ + ' operator to add two complex numbers.
- What is the output of the code? 5 # include <iostream> using namespace std; class cons public : int m; void init () m = 80; cons () init (); ; int main () cons S; cout << S.m;
- Write a C++ program to arrange N integers in descending order.
- What is the need of using function templates? How will you create and use the function template?
- Write a C++ program to generate fibonacci numbers using copy constructor.
- Write a program to create a template to find the maximum value stored in an array.
- Explain how to handle exceptions using try, catch and throw mechanism.
- Predict the output of the following code : 5 # include <iostream> using namespace std; namespace a name space int fl(int a, int b) int c = a+b; cout << c << ""; name space b name space int f1 (int a, int b) int c = a-b; cout << c << ""; int main () a name space : : f1 (2,2); b name space : : f1 (1,1);
- Write a C++ program to find the HCF and LCM of three positive integers.