July 7, 2021 in C and CPP
Write a class number. Calculate the power to be raised of that number.
a) Write a class number. Calculate the power to be raised of that number.
July 7, 2021 in C and CPP
a) Write a class number. Calculate the power to be raised of that number.
July 7, 2021 in C and CPP
c) Write a program for class implementation, which takes an age, name and salary of employee. Use a constructor for initialization of objects. Define a destructor.
July 7, 2021 in C and CPP
b) Explain copy constructor with example. What is its use?
July 7, 2021 in C and CPP
a) What is an abstract class? How do you create an abstract class? Explain it using example.
July 7, 2021 in C and CPP
c) Explain with suitable example pointer to object. How can we access function or variable with the help of pointer to object?
July 7, 2021 in C and CPP
b) What happens if we don’t use virtual function in inheritance? Explain importance of virtual function with this reference.
July 7, 2021 in C and CPP
a) Explain polymorphism and data hiding in c++ with suitable examples.
July 7, 2021 in C and CPP
A. Lifetime B. Ostream C. Calling
D. Structures E. One F. Abstract class
G. Two H. Class name I. Private
J. Default constructor K. Class L. Constant
M. Visibility N. Variable O. Void
4.1 A(n) _______ is user defined data type, which holds both the data and function.
4.2 Member functions defined inside a class specifier are _______ by default.
4.3 Storage classes concerned with the lifetime are ________ of a variable.
4.4 A function that doesn’t return anything has return type ___________.
4.5 Character ‘A’ occupies _______bytes.
4.6 Sending a message to an object is same as ________ member function.
4.7 Data and member function are public in _________ but private in classes, by default.
4.8 A constructor’s name is the same as _________.
4.9 Cerr and clog are standard streams of type_________.
4.10 An address of a variable is ________.
July 7, 2021 in C and CPP
Each statement below is either TRUE or FALSE. Choose the most appropriate one and
ENTER in the “tear-off” sheet attached to the question paper, following instructions
therein.
2.1 C++ requires const to be initialized.
2.2 When we are using manipulator we are in fact calling a member function.
2.3 We can inherit a new class from the class template.
2.4 When an exception is not caught, the program is aborted.
2.5 A class can inherit the attributes of two or more classes, is known as multilevel inheritance.
2.6 A constructor can be used to convert a class type to basic type data.
2.7 NULL is a keyword.
2.8 The static member variables must be defined outside the class.
2.9 Pure virtual functions can never have a body.
2.10 Creating a derived class from a base class requires a fundamental change to the base class.
July 7, 2021 in C and CPP
1.10 Which of the following way are legal to access a class data member using this pointer?
A) this.x
B) *this.x
C) *(this.x)
D) (*this).x