July 9, 2021 in C and CPP
Describe the basic concepts of Object Oriented Programming and bring out the advantages of OOP.
a) Describe the basic concepts of Object Oriented Programming and bring out the advantages
of OOP.
July 9, 2021 in C and CPP
a) Describe the basic concepts of Object Oriented Programming and bring out the advantages
of OOP.
July 9, 2021 in C and CPP
c) How do you differentiate between overloading the prefix and postfix increments? Can you
overload the operator+ for short integers? Is it legal in C++ to overload operator++ so
that it decrements a value in your class?
July 9, 2021 in C and CPP
b) How to initialize more than one variable in a for loop? Is it possible to write a for loop with a body that is never executed? Is it possible to create a loop that never ends? Give an example. What happens if you create a loop that never ends?
July 9, 2021 in C and CPP
a) When is the copy constructor called? When is the destructor called? How does the copy
constructor differ from the assignment operator (=)?
July 9, 2021 in C and CPP
b) What are containers? Explain with the help of suitable example.
July 9, 2021 in C and CPP
b) What are containers? Explain with the help of suitable example.
July 9, 2021 in C and CPP
a) Write a program that creates two SimpleCircle objects. Use the default constructor on
one and instantiate the other with the value 9. Call increment operator ++ on each
object and then print their values. Finally, assign the second to the first and print its values.
July 9, 2021 in C and CPP
A. Inheritance B. Private C. After
D. Ostream E. Contents F. Derived Class
G. Base Class H. Before I. istream
J. While K. Process.h L. Math.h
M. Public N. Constructor O. Class
4.1 ________ allows to derive new classes from already existing classes.
4.2 ________ is a control statement that can be used when uncertain numbers of loopings are
there.
4.3 ________ header file should be included to use the function exit ( ).
4.4 Inline function should be defined ________ the main ( ) program.
4.5 An object can be initialized on creation using ________.
4.6 A constructor’s name is same as _________ name.
4.7 ________ type of declaration of a base class enables an object of a derived class to access member functions.
4.8 A variable returns ________, if it is simply referenced by its name.
4.9 put ( ) and write ( ) are member functions of ________.
4.10 A virtual function should be defined and declared in ________.
July 9, 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 All functions of an abstract class must be abstract.
2.2 Constructor should be called explicitly.
2.3 The body of the “for” loop executes before executing the test expression in “for” loop.
2.4 It is possible to inherit a new class from class template.
2.5 Object Oriented Programming language permits functional and data abstractions.
2.6 A class can have public data and private functions.
2.7 Operator overloading is called compile time polymorphism.
2.8 When an exception is thrown an exception class’s constructor gets called.
2.9 A pure virtual function can never have a body.
2.10 cerr and clog are standard streams of type ostream.
July 9, 2021 in C and CPP
1.10 To write data to a file, you create an instance of
A) iostream
B) ifstream
C) ofstream
D) stream