cse_ass2024
cse_ass2024
int main( ) {
const double PI;
int n;
PI = 3.14159265358979;
n = 22;
}
(iv) When a multidimensional array is passed to a function, why does C++ require all
but the first dimension to be specified in parameter list?
(v) Why can’t ** be overloaded as an exponentiation operator?
(vi) How many constructors can a class have, and how should they be distinguished.
Q.26 Identify and remove error from the following, if any :*
array_ptr = new int [10] [10] [10];
array_ptr = new int [20] [ ] [ ]; (2)
Q.27 What is the task of the following code:* (2)
cout << setw (4) << XYZ << endl
Q.33 What is multiple inheritance? Discuss the syntax and rules of multiple inheritance
in C++. How can you pass parameters to the constructors of base classes in
multiple inheritances? Explain with suitable example. * (6)
Q.35 What do you mean by static class members? Explain the characteristics of static
class members with suitable examples. *** (6)
Q.43 Explain the difference between macro & function.*** (6)
Q.44 Write a C++ program to find the sum of digits of a number reducing it to one digit.***
(6)
Q.45 Explain the use of break and continue statements in switch case statements.***
(6)
Q.46 What is Object Oriented Programming (OOP)? What are the advantages of
Object Oriented Programming?* (3)
Q.47 Differentiate between recursion and iteration.** (6)
Q.48 What are the different storage classes in C++.** (6)
Q.49 Write a program to overload the unary minus operator using friend function.* (6)
Q.50 Write a program in which a class has three data members: name, roll no, marks of 5
subjects and a member function Assign() to assign the streams on the basis of table
given below:* (6)
Q.54 Write a C++ program to prepare the mark sheet of a university examination with
the following items from the keyboard:* (6)
Name of the student
Roll no.
Subject name
Subject code
Internal marks
External marks
Design a base class consisting of data members Name of the student and Roll no.
The derived class consists of the data members Subject name, Subject code,
Internal marks and External marks.
Q.68 Why is destructor function required in class? What are the special characteristics
of destructors? Can a destructor accept arguments? *** (3)
Q.70 Differentiate and give examples to bring out the difference between following ***
1. private and public inheritance.
2. instantiation and specialization of a template class.(leave it)
3. static and dynamic binding.
4. a class and a struct (4x 3)
Q.71 Explain the order in which constructors are invoked when there is multiple
inheritance.* (4)
Q88 What is encapsulation? What are its advantages? How can encapsulation be
enforced in C++? *** (6)
Q.92 Differentiate and give examples to bring out the difference between *
1. function overloading and function overriding
2. function template and inline functions (Leave it)
3. default constructor and copy constructor
4. public and private access specifiers (4 x3 =12)
Q.93 The keyword ‘virtual’ can be used for functions as well as classes in C++. Explain
the two different uses. Give an example each.*** (6)
Q.110 What is the difference between passing a parameter by reference and constant
reference? * (3)
Q.111 Define the following terms and give an example to show its realization in C++ *
(i) Encapsulation (ii) Class variables and class functions (iii) Repeated inheritance
(iv) Overloading (3 x 4)