You are on page 1of 3
4318) September 2021 OBJECT ORIENTED PROGRAMMING ‘Time Allowed: 1.5 Hours Full Marks: 70 Answer to Question No.1 is compulsory and Answer any two questions from the rest. I Choose the correct answer from the given alternatives (any twenty) 20x2 i vi. vii. viii, xi Which of the following best defines a class? a) Parent of an object, b) Instance of an object, c) Blueprint of an object, d) Scope of an object Which is not feature of OOP in general definitions? a) Code reusability, b) Modularity, c) Duplicate/Redundant data, d) Efficient Code Which Feature of OOP illustrated the code reusability? 1a) Polymorphism, b) Abstraction, c) Encapsulation, d) Inheritance What is default access specifier for data members ot member functions declared within a class without any specifier, in Cr+? a) Private, b) Protected, c) Public, d) Depends on compiler Which syntax for class definition is wrong? a) class student{ };, b) student class{ };, c) class student{ public: student(int a){ } };, d) class student{ student(int a){} }s Which among the following is false for class features? a) Classes may/may not have both data members and member functions, b) Class definition must be ended with a colon, c) Class can have only member functions with no data members, €) Class is similar to union and structures Pass by address passes the address of object and pass by reference passes the address of the object a) Explicitly, explicitly, b) Implicitly, implicitly, e) Explicitly, Implicitly, d) implicitly, explicitly Which among the following is called first, automatically, whenever an object is created? a) Class, b) Constructor, c) New, d) Trigger Which among the following is not a necessary condition for constructors? a) _Itsmame must be same as that of class, 6) It must not have any return type, ¢) It must contain a definition body, d) It can contains arguments Which among the following is correct? a) class student{ public: int student(){} }: b) class student{ public: void student Q{} Is c) class student{ public: student }{} Js 4) class student{ public: stadent(){} }: Which among the following describes a destructor? a) A special function that is called to free the resources, acquired by the object, b) A special function that is called to delete the class, c) A special function that is called anytime to delete an object, d) A special function that is called to delete all the objects of a class Which type of function among the following shows polymorphism? a) Inline function, b) Virtual function, c) Undefined functions, d) Class member functions https://www.wbscteonline.com Which among the following can’t be used for polymorphism? a) Static member functions, b) Member functions overloading, c) Predefined operator overloading, d) Constructor overloading xiv. Which among the following best describes the Inheritance? a) Copying the code already written, b) Using the code already written once, c) Using already defined functions in programming language, d) Using the data and functions into derived segment xv. Which among the following best defines single level inheritance? a) Acclass inheriting a derived class, b) A class inheriting a base class, ¢) A class inheriting a nested class, d) A class which gets inherited by 2 classes xvi, Which programming language doesn’t support multiple inheritance? a) C#+ and Java, b) C and C+, c) Java and SmallTalk, d) Java xvii. Which among the following best describes multiple inheritance? a) Two classes being parent of any other classes, b) Three classes being parent of other classes, ©) More than one class being parent of other child classes, d) More than one class being parent of single chilé. https://www.wbscteonline.com xviii, What is an exception? a) Problem arising during compile time, b) Problem arising during runtime, ¢) Problem in syntax, 4) Problem in IDE, xix. Why do we need to handle exceptions? a) To prevent abnormal termination of program, b) To encourage exception prone program, ¢) To avoid syntax errors, d) To save memory xx. Which of the following is true about templates? 1) Template is a feature of C++ that allows us to write one code for different data types. 2) We can write one function that can be used for all data types including user defined types. Like sort(), max(), minQ), .cte. 3) We can write one class or struct that can be used for all data types including user defined types. Like Linked List, Stack, Queue .etc. 4) Template is an example of compile time polymorphism. a) | and2 b) 1, 2and 3 o) 1, 2and 4 d) 1,2, 3and4 xxi, Which stream class is to only write on files? a) ofstream, b) ifstream, c) fstream, d) iostream Which of the following true about FILE *fp a) FILE sa structure and fp is a pointer to the structure of FILE type, b) FILE is a buffered siteam, c) PILE is a keyword in C for representing files and fp is a variable of FILE type, 6) FILE isa stream What does the following statement mean? int (*fpychar*) a) Pointer to pointer, b) Pointer to an array of chars, c) Pointer to function taking 2 char* ‘argument and returns an int, d) Function teking a char* argument and returning a pointer to int xxiv. A void pointer cannot point to which of these? a) Methods in c++, b) Class member in c++, c) Both A & B, d) None of the above xy. Which was the first purely object oriented programming language developed? a) Java, b) C++, c) SmallTalk, d) Kotlin https://www.wbscteonline.com a) What is Constructor? Explain characteristics of a constructor, b) Explain parameterized-constructor with suitable code. 34547 a) Describe the importance of Destructor. 'b) Write an C++ program that implement the concept of Destructor. ) Explain copy constructor with suitable code, 34646 12) What is operator overloading?” b) Why is it necessary to overload an operator? ©) What is an operator function? Describe the syntax of an operator function. @) Explain Fonction overloading using suitable code. €) List the operators which can’t be overloaded. 343434541 a) What does inheritance means in C44? b) What are the different forms of Inheritance? Give an example for each. ©) Describe the syntax of the single inheritance in CH. 4) What do you mean by “Code Reusability”. 3454542 8) What does Polymorphism mean in C++ language? 1b) What does ‘this’ pointer do? ©) What is virtual and pure virtual function? Deseribe using suitable code. 34349 a) What is an Exception? b) How is an exception handled in C+#? ) What are the advantages of using exception handling mechanism in a program? @) Write an simple C+ program that handles different types of exception. ©) Write down the function of try, throw and catch. 234d? a) What is Generic programming? How is it implemented in C- b) Distinguish between overloaded functions and function template. ©) Explain class template with suitable C++ code. 54545 a) What are input and output stream? 'b) What is File mode? Describe the various file mode options available ©) Explain command line argument with suitable code. 34547 8) Compare and Contrast Procedure Oriented Paradigm and Object Oriented Paradigm with help of a diagram. b) What are the features of Object Oriented Paradigm? 7541.5 4) Distinguish between class and object with example code. 1b) Explain Inline Function using suitable C++ programming code ©) Describe static member function 61643 a) What is Friend function? b) Explain the purpose of Friend function in C++. ©) Explain the concept Array of Object using C++ code, 34349 3 https://www.wbscteonline.com

You might also like