July 16, 2021 in C and CPP
b) Explain the structure of a C++ program.
July 16, 2021 in C and CPP
a) Justify: Object-oriented programming is better than procedural programming.
July 16, 2021 in C and CPP - 3
A. stream B. pointer C. setw
D. abstract class E. stdio F. data
G. malloc( ) H. iostream I. new
J. protected K. late binding L. container
M. static binding
4.1 A class that is not used to create any object is known as ________.
4.2 A class that can contain objects of other classes is called ________ class.
4.3 The function which is linked with a particular class after compilation is known as ________.
4.4 cin and cout are the objects of ________ class.
4.5 In OOP, emphasis is on ________ rather than procedure.
4.6 ________ operator is used to allocate run time memory.
4.7 ________ access specifier allows access within its class and a class immediately derived from it only.
4.8 ________ is also known as field width operator.
4.9 this is a ________ that acts as an implicit argument to all the member functions.
4.10 A _____ acts as an interface between the program and the I/0 devices.
July 16, 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 An object is a variable of a class.
2.2 Using return by reference, a function call can appear on left-hand side of the assignment statement. e.g. min(a,b) =2.
2.3 endl is a keyword which has the same effect as using newline character.
2.4 Constructor can not be overloaded.
2.5 The compiler reports an error if overloaded + operator perform – operation.
2.6 Template functions can be overloaded, like other functions.
2.7 A class inherited from more than one class is known as multiple inheritances.
2.8 Two pointers can be multiplied in C++.
2.9 ios is a base class for istream and ostream classes.
2.10 A virtual function can be a friend of another class.
July 16, 2021 in C and CPP
1.10 The class member access operator connects the following two entities
A) A class member and a class object
B) A class object and a class
C) A class and a member of that class
D) A class object and a member of that class
July 16, 2021 in C and CPP
1.9 Which is the legal function declaration with default arguments?
A) void user_def (float x=1,int n=2, char c);
B) void user_def (float x=1, int n, char c=’a’);
C) void user_def (float x, int n=2, char c=’a’);
D) void user_def (float x, int n=2, char c)
July 16, 2021 in C and CPP
1.8 This is the characteristic of the static member function of a class
A) It can be called using the class name instead of its objects
B) It cannot have static data members
C) It must be defined private section of the class
D) None of the above
July 16, 2021 in C and CPP
1.7 This is the correct syntax to define destructor of a class named Complex
A) void Complex( )
B) Complex(void)
C) ~operator Complex( )
D) ~Complex( )
July 16, 2021 in C and CPP
1.6 When an entire array is passed as an argument of a function
A) The reference variable must be passed to the function definition
B) The base address is passed to the function definition
C) It is passed as Call by value
D) None of the above