CS304 Object Oriented Programming Final Term

Similar documents
CS304 Object Oriented Programming

CS304- Object Oriented Programming LATEST SOLVED MCQS FROM FINALTERM PAPERS. MC

OBJECT ORIENTED PROGRAMMING USING C++ CSCI Object Oriented Analysis and Design By Manali Torpe

CLASSES AND OBJECTS IN JAVA

Short Notes of CS201

KOM3191 Object Oriented Programming Dr Muharrem Mercimek OPERATOR OVERLOADING. KOM3191 Object-Oriented Programming

C++ (Non for C Programmer) (BT307) 40 Hours

Object-Oriented Programming

FINAL TERM EXAMINATION SPRING 2010 CS304- OBJECT ORIENTED PROGRAMMING

Object Oriented Programming. Assistant Lecture Omar Al Khayat 2 nd Year

CS201 - Introduction to Programming Glossary By

What are the characteristics of Object Oriented programming language?

Intro to OOP Visibility/protection levels and constructors Friend, convert constructor, destructor Operator overloading a<=b a.

Instantiation of Template class


Programming, numerics and optimization

I BSc(IT) [ Batch] Semester II Core: Object Oriented Programming With C plus plus - 212A Multiple Choice Questions.

JAYARAM COLLEGE OF ENGINEERING AND TECHNOLOGY Pagalavadi, Tiruchirappalli (An approved by AICTE and Affiliated to Anna University)

Jayaram college of Engineering and Technology, Pagalavadi. CS2203 Object Oriented Programming Question Bank Prepared By: S.Gopalakrishnan, Lecturer/IT

(5 2) Introduction to Classes in C++ Instructor - Andrew S. O Fallon CptS 122 (February 7, 2018) Washington State University

Object-Oriented Design (OOD) and C++

Object Oriented Programming. Solved MCQs - Part 2

SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR

Lecture 3. COMP1006/1406 (the Java course) Summer M. Jason Hinek Carleton University

Lecture 18 Tao Wang 1

Interview Questions of C++

CS304 Lecture Wise Questions by Virtualians Social

Introduction to Programming Using Java (98-388)


Ch. 12: Operator Overloading

Data Structures using OOP C++ Lecture 3

AN OVERVIEW OF C++ 1

+2 Volume II OBJECT TECHNOLOGY OBJECTIVE QUESTIONS R.Sreenivasan SanThome HSS, Chennai-4. Chapter -1

Learning Objectives. C++ For Artists 2003 Rick Miller All Rights Reserved xli

3.Constructors and Destructors. Develop cpp program to implement constructor and destructor.

Object-Oriented Programming (OOP) Fundamental Principles of OOP

Kapil Sehgal PGT Computer. Science Ankleshwar Gujarat Chapter 6 Inheritance Extending a Class

OOPS Viva Questions. Object is termed as an instance of a class, and it has its own state, behavior and identity.

Fast Introduction to Object Oriented Programming and C++

Cpt S 122 Data Structures. Introduction to C++ Part II

Data Structures (list, dictionary, tuples, sets, strings)

Subclass Gist Example: Chess Super Keyword Shadowing Overriding Why? L10 - Polymorphism and Abstract Classes The Four Principles of Object Oriented

C++ Important Questions with Answers

CMSC 132: Object-Oriented Programming II

CMSC 202 Section 010x Spring Justin Martineau, Tuesday 11:30am

OBJ. ORI.& MULT. PROG., M.C.Q. BANK, FOR UNIT -2, SECOND YEAR COMP. ENGG. SEM-4, 2012 PATTERN, U.O.P. UNIT-2

An Introduction to C++

Module Operator Overloading and Type Conversion. Table of Contents

Object Oriented Design

ADTs & Classes. An introduction

Page No.1. CS304 OOP_ Muhammad Ishfaq

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub

Day 4. COMP1006/1406 Summer M. Jason Hinek Carleton University

OBJECT ORIENTED PROGRAMMING. Ms. Ajeta Nandal C.R.Polytechnic,Rohtak

STRUCTURING OF PROGRAM

THE NAME OF THE CONSTRUCTOR AND DESTRUCTOR(HAVING (~) BEFORE ITS NAME) FUNCTION MUST BE SAME AS THE NAME OF THE CLASS IN WHICH THEY ARE DECLARED.

Kapil Sehgal PGT Computer. Science Ankleshwar Gujarat

Quiz Start Time: 09:34 PM Time Left 82 sec(s)

END TERM EXAMINATION

CS201 Latest Solved MCQs

Chapter 6 Introduction to Defining Classes

Chapter 5 Object-Oriented Programming

Inheritance, and Polymorphism.

Object Oriented Programming in Java. Jaanus Pöial, PhD Tallinn, Estonia

Object Oriented Programming is a programming method that combines: Advantage of Object Oriented Programming

Classes. Christian Schumacher, Info1 D-MAVT 2013

Chapter 10 Introduction to Classes

Ch02. True/False Indicate whether the statement is true or false.

PART A : MULTIPLE CHOICE Circle the letter of the best answer (1 mark each)

public : int min, hour ; T( ) //here constructor is defined inside the class definition, as line function. { sec = min = hour = 0 ; }

Data Abstraction. Hwansoo Han

Paytm Programming Sample paper: 1) A copy constructor is called. a. when an object is returned by value

Overview of OOP. Dr. Zhang COSC 1436 Summer, /18/2017

6.096 Introduction to C++ January (IAP) 2009

Introduction Of Classes ( OOPS )

C++_ MARKS 40 MIN

CS3157: Advanced Programming. Outline

Weiss Chapter 1 terminology (parenthesized numbers are page numbers)

I BCS-031 BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination. June, 2015 BCS-031 : PROGRAMMING IN C ++

2 ADT Programming User-defined abstract data types

Collected By Anonymous

Padasalai.Net s Model Question Paper

Object Oriented Design

Java Object Oriented Design. CSC207 Fall 2014

Abstraction in Software Development

Compositional C++ Page 1 of 17

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING CS6456 OBJECT ORIENTED PROGRAMMING

Abstract Data Types (ADTs) 1. Legal Values. Client Code for Rational ADT. ADT Design. CS 247: Software Engineering Principles

Object-Oriented Programming

Page. No. 1/15 CS201 Introduction to Programmming Solved Subjective Questions From spring 2010 Final Term Papers By vuzs Team

CS201 Some Important Definitions

Week 8: Operator overloading

G52CPP C++ Programming Lecture 13

CS 247: Software Engineering Principles. ADT Design

Example : class Student { int rollno; float marks; public: student( ) //Constructor { rollno=0; marks=0.0; } //other public members };

Distributed Real-Time Control Systems. Lecture 14 Intro to C++ Part III

CMPT 117: Tutorial 1. Craig Thompson. 12 January 2009

Introduction to Programming session 24

Absolute C++ Walter Savitch

MaanavaN.Com CS1203 OBJECT ORIENTED PROGRAMMING DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

Transcription:

1. Which of the following is the way to extract common behaviour and attributes from the given classes and make a separate class of those common behaviours and attributes? Generalization (pg 29) Sub-typing Specialization Extension 2. Abstraction is a feature of OOP which enables an object to -------------. Increase Complexity Decrease Complexity (pg 21) Increase Modularity Decrease Modularity 3. In a class, objects cannot- have common. Behaviour Attributes States Names 4. Which of the following is an example of multiple inheritances? Student Woman (Lecture 5) Mermaid Train 5. A C++ class is similar to a. Structure (pg65) Header File Library File Function 6. Which of the following is used to free the memory space allocated as a result of object declaration? Constructor New operator Destructor (pg 81) Accessor Function 7. and methods may not be declared abstract. 1

Private,Static Private,Public Static,Public Static, Protected 8. If a static variable is not explicitly initialized at the time of its definition then, The compiler will give an error message The compiler will give a warning message The compiler will initialize it with value Zero. (pg 107 ) The program terminates 9. Object cannot be declared constant if it is required to change the state of its. Constant data members (pg 105) Non-constant data members Constant member functions Static data members 10. A friend function can access a class s private data without being a. Static member of the class None member of the class Member of the class (pg 135) Constant member of the class 11. Identify which of the following overloaded operator function s declaration is appropriate for the given call? Rational_number_1 + 2.325 Hint: Where Rational_number_1 is an object of user defined class Rational_number. Rational_number operator+( Rational_number & obj); Rational_number operator+(double& obj); (pg 145) Rational_number operator+(rational_number &obj, double& num); operator+(double& obj); 12. A class can be identified from a statement by -------------. Noun (pg 58) Pronoun Verb Adverb 13. The return type of a constructor is of -------------. Integer Character Double No type (pg74) 14. Suppose obj1 and obj2 are two objects of a user defined class A. An + operator is overloaded to add obj1 and obj2 using the function call obj1+obj2. Identify the correct function prototype against the given call? A operator + ( A &obj); int + operator(); int operator (plus) (); (pg 143) A operator(a &obj3); 15. Abstract classes have..object/s, while concrete classes have..object/s. One, One More than one, more than one 2

No, One or more No, One 16. If MyClass has a destructor its name will be, MyClass ~MyClass (reference 232) My~Class MyClass~ 17. A static member function can be called, even when an object is not. Excecute Define Instantiated Mention 18. Consider the following code segment: void UserInfo (Complex & C1){ C1=C1; } It is an example of: Assignment Self assignment Compound assignment Multiple assignments 19. While overloading the stream insertion operator, the return type must be. Ostream (pg 156) Istream Instream Iostream 20. To overload subscript operator, it requires one type parameter. Int (pg 160) Float Char String 1. When the base class cannot be replaced by its derived class then it is called, Sub-typing (pg 31) Super-typing Generalization Specialization 2. Suppose that the Test class does not have an overloaded assignment operator. What happens when an assignment a=b; is given for two Test objects a and b? The automatic assignment operator is used The copy constructor is used Compiler error Run-time error 3. By default, which access level is assigned to members of a class? 3

Public Private Local Protected 4. In OOP's, advantage of inheritance include all of the given below except, Provide a useful conceptual framework Reusing the code (pg 26) Dealing with real world entities Decrease maintainability 5. Main problem(s) with multiple inheritances includes. Increased Complexity, Reduced Understanding, Less Reusability Increased Complexity, Decreased Code Redundancy, Less Reusability Increased Complexity, Reduced understanding, Duplicate Features (pg45) Increased Complexity, Less Reusability, Duplicate Features 6. Which is true about sub-typing in case of inheritance? In sub-typing derived class shows some extended behavior of its parent. (Pg. ) In sub-typing derived class shows some restricted behavior of its parent class. In sub-typing derived class should be abstract. Sub-typing has no relation with inheritance 7. The keyword tells the compiler to substitute the code within the function definition for every instance of a function call. Virtual Inline (Pg. 72) Instance Static 8. The function that is automatically called when an object of a class is created is named as. Constructor (Pg. 74) Destructor Member Functions Inline Functions 9. Which will be the good example of a method that is shared by all instances of a class? Virtual method Overloaded method Constant method Static method (Pg. 108) 10. If you do not initialize static variable of int type then it is automatically initialized with. 0 (Pg. 107) 1-1 Null 11. Which one is not keyword in C++? operator 4

B_op const using 12. We capture the object attributes and behavior in Object Oriented programming using------ ---------. Class (pg 15) Function Data Members Instances 13. The return type of a constructor is of -------------. Integer Character Double No type (pg 74) 14. For more than one member in initializes list, then we use to separate them. Dot (.) Comma (,) (pg 104) Colon (:) Semicolon(;) 15. Assume a class C with objects obj1, obj2, and obj3. For the statement obj3 = obj1 - obj2 to work correctly, if the overloaded - operator must Take two arguments. Return a value. Create a named temporary object. Take four arguments. 16. To convert from a user-defined class to a basic type, you would most likely use a conversion operator that s a member of the class. (pg168) a built-in conversion operator. a one-argument constructor. an overloaded = operator. 17. A generalization-specialization relation between classes are implemented using Data hiding Friend classes Encapsulation Inheritance (pg 49) 18. Operator overloading is: Making C++ operators able to work with objects. Giving C++ operators more than they can handle. (pg 139) Giving new meanings to existing Class members. Making new C++ operators. 19. The life of sub object is dependant on the life of master class in. Separation Composition (Pg. 120) Aggregation Association 20. operator will take only one operand. New Const Int 5

This 1. Which one of the following features of OOP is used to deal with only relevant details? Abstraction (pg 23) Information hiding Object Inheritance 2. Inheritance is a way to make general classes into more specific classes. (pg 27) pass arguments to objects of classes. improve data hiding and encapsulation. providing class growth through natural selection. 3. Consider the code below, class Fred { public: Fred();... }; int main() { Fred a[10]; Fred* p = new Fred[10];... } Select the best option, A) Fred a[10]; calls the default constructor 09 times Fred* p = new Fred[10]; calls the default constructor 10 times B) Produce an error C) Fred a[10]; calls the default constructor 11 times Fred* p = new Fred[10]; calls the default constructor 11 times (Pg. 175) D) Fred a[10]; calls the default constructor 10 times Fred* p = new Fred[10]; calls the default constructor 10 times 4. Which operator can not be overloaded? The relation operator ( >= ) Assignment operator ( = ) Script operator ( [] ) Conditional operator (? : ) (pg 141) 5. Abstraction is a feature of OOP which enables an object to -------------. Increase Complexity Decrease Complexity Increase Modularity Decrease Modularity 6. Composition is an example of relationship. Simple Complex Strong (Pg. 53) Weak 7. Consider a class having name MyClass, what will be the name of this class constructor? 6

MyClass Myclass myclass myclass 8. The function that is automatically called when an object of a class is created is named as. Constructor (Pg. 74) Destructor Member Functions Inline Functions 9. The const member functions uses following specifers. Only access Only read (Pg. 100) Access and read only Access, read, and modify 10. The life of sub object is not dependant on the life of master class in. Composition Aggregation (pg 134) Separation Abstraction 11. Friend functions are functions of a class. Object member Member Non-member (pg 136) Static member 12. Suppose obj1 and obj2 are two objects of a user defined class A. An + operator is overloaded to add obj1 and obj2 using the function call obj1+obj2. Identify the correct function prototype against the given call? A operator + ( A &obj); int + operator(); (pg 143) int operator (plus) (); A operator(a &obj3); 13. A generalization-specialization relation between classes are implemented using Data hiding Friend classes Encapsulation Inheritance (pg 49) 14. A real world object s attributes are represented through, Member function Data members(pg. 14) Global variables Const data members 15. Why we should avoid the use of friend function/class? Friend function/class minimizes encapsulation (Pg. 153) Difficult to use Decreases complexity Increase program code size 16. Which of the following is NOT an advantage of information hiding? Simplifies the model 7

Restriction to change Prevents damage from errant external code Provide direct access to data members 17. Assume that a user wants to count, how many objects are created for a particular class, which one will be most suitable to perform this task: Const data member Non static data member Static data member Global data member 18., which means if A declares B as its friend it does NOT mean that A can access private data of B. It only means that B can access all data of A. Friendship is one way only (Pg.292 ) Friendship is two way only NO Friendship between classes Any kind of friendship 19. Consider the following code segment: void UserInfo (Complex & C1){ C1=C1; } It is an example of: Assignment Self assignment (Pg. 151) Compound assignment Multiple assignment 20. Subscript operator must be of the class when overloaded. Static function Virtual function Member function (pg 160) Non member function 1. What is a class? A class is a section of computer memory containing objects. A class is a section of the hard disk reserved for object oriented programs A class is the part of an object that contains the variables. A class is a description of a kind of object. 2. Suppose that the Test class does not have an overloaded assignment operator. What happens when an assignment a=b; is given for two Test objects a and b? The automatic assignment operator is used The copy constructor is used Compiler error Run-time error 3. Consider the following statement. "Cupboard has books" What is the relationship between Cupboard and books? 8

Composition Aggregation (Pg. 54) Inheritance Association 4. Which of the following is directly related to polymorphism? Const members Overriding (pg ) Static members Const members functions 5. The constructor of a class is called when --------------. An object is change its state An object is executed An object is created (pg 74) An object is destroyed 6. Which will be the good example of a method that is shared by all instances of a class? Virtual method Overloaded method Constant method Static method 7. The const member functions uses following specifers. Only access Only read (Pg. 100) Access and read only Access, read, and modify 8. Friend functions are functions of a class. Object member Member Non-member (pg 136) Static member 9. The return type of a constructor is of -------------. Integer Character Double No type (Pg. 74) 9

10. For more than one member in initializer list, then we use to separate them. Dot (.) Comma (,) (Pg. 104) Colon (:) Semicolon(;) 11. Given the following class class Base{ int Age=33; } How you can improve above class with respect to accessing the field Age? Define the variable Age as private Define the variable Age as protected Define the variable Age as private and create a get method that returns it and a set method that updates it Define the variable Age as protected and create a set method that returns it and a get method that updates it 12. A normal C++ operator that acts in special ways on newly defined data types is said to be Glorified. Encapsulated. Classified. Overloaded. 13. To convert from a user-defined class to a basic type, you would most likely use a conversion operator that s a member of the class. a built-in conversion operator. a one-argument constructor. an overloaded = operator. 14. A generalization-specialization relation between classes are implemented using Data hiding Friend classes Encapsulation Inheritance (Pg. 49) 15. Abstract classes have..object/s, while concrete classes have..object/s. One, One More than one, more than one No, One or more (Pg. 229) No, One 16. Hiding details of an object from the other parts of a program is done by which principle of OOP? Obfustication Data Mining Compilation Encapsulation (pg 16) 10

17. Graphical representation of the classes and objects is called object model it shows ---- ---. Class name, Attributes, States, Operations Class name, Attributes, Operations, Methods Class name, Attributes, Operations, Behaviour Class name, Attributes, Operations, Relationship 18. Consider the following function: void multiplication (int x, int y); If we overloaded the above function, then it will require. operands. One Two Three Four 19. Consider the following code segment: void UserInfo (Complex & C1){ C1=C1; } It is an example of: Multiple assignment Assignment Self assignment (Pg. 151) Compound assignment 20. While overloading the stream extraction operator, the return type must be. Ostream Iostream Istream Instream 1.Which one of the following is not a major element of an Object Model? Abstraction Encapsulation Persistence Hierarchy 2. Encapsulation is a feature of Object Oriented Programming which means, Keep data separated from code Keep data and code in a single place (Pg. ) Keep data separated from code and also keep data and code in a single place Reusing code by creating new classes from previously created classes 3. Reusability can be achieved through. Inheritance Aggregation Association Abstraction 4. Which of the following is directly related to polymorphism? 11

Const members Overriding Static members Const members functions 5. Which of the class s members are available to every one? Public Private Protected Internal 6. A member function having the same name as the class name preceded by a tilde (~) sign is called. Constructor Getter Setter Destructor (pg 92) 7. Which of the following is used to free the memory space allocated as a result of object declaration? Constructor New operator Destructor (Pg. 81) Accessor Function 8. provide the facility to access the data member. Accesser function (pg 68) Private function Inline function Constructor 9. What will be the value of the variable data and data2 respectively, If the function below is called 4 times? void func() { static int data = 4; int data2 = 4; ++data; ++data2; } 8, 5 5, 8 5, 5 7, 5 10. In, a pointer or reference to an object is created inside a class. Aggregation (Pg. 134) Composition Separation Association 12

11. Identify which of the following overloaded operator function s declaration is appropriate for the given call? Rational_number_1 + 2.325 Hint: Where Rational_number_1 is an object of user defined class Rational_number. Rational_number operator+( Rational_number & obj); Rational_number operator+(double& obj); (Pg. 145) Rational_number operator+(rational_number &obj, double& num); operator+(double& obj); 12. We capture the object attributes and behavior in Object Oriented programming using------ ---------. Instances Class (pg 15) Function Data Members 13. A normal C++ operator that acts in special ways on newly defined data types is said to be Glorified. Encapsulated. Classified. Overloaded. 14. Suppose obj1 and obj2 are two objects of a user defined class A. An + operator is overloaded to add obj1 and obj2 using the function call obj1+obj2. Identify the correct function prototype against the given call? A operator + ( A &obj); int + operator(); int operator (plus) (); (pg 143) A operator(a &obj3); 15. A generalization-specialization relation between classes are implemented using Data hiding Friend classes Encapsulation Inheritance (pg 49) 16. The technique in which we visualize our programming problems according to real life s problems is called. Structured programming Object oriented programming (pg 9) Procedural programming Sequential programming 17. How many objects for a class can be constructed in an application? Only one per constructor. As many as the application asks for. Only one per class. One object per variable. 18. We change the evaluation precedence of operators through operator overloading. 13

Can Can not Only Just 19. Subscript operator must be of the class when overloaded. Static function Virtual function Member function (Pg. 160) Non member function 20. friend Complex & operator -(Complex & t); It is the declaration of: Unary minus member function Unary minus non member function Unary minus static member function Unary minus non static member function 1. Inheritance is a way to organize data. pass arguments to objects of classes. add features to existing classes without rewriting them. (pg 27) improve data-hiding and encapsulation. 2. The ability to derive a class from more than one classes is called, Single inheritance Encapsulation Multiple inheritance Polymorphism 3. For classes with common behavior, you can save effort by placing the common behavior in a. Derived Class Base class (pg 29) Deprived Class Named class 4. If Rollno is a const data member of a class student then which definition is correct for the member function show () int show() const { return Rollno; } void show() const { return Rollno; } int show() const { return Rollno + 50; } int show(num) const { Rollno = num; } 5. An overloaded operator always requires argument than its number of operands. One less (pg 896) One most Two less Three most 6. Which of the following is a weak relationship between two objects? Inheritance Composition Aggregation 14

Association 7.The constructor of a class is called when --------------. An object is change its state An object is executed An object is created An object is destroyed 8. The function that is automatically called when an object of a class is created is named as. Constructor (Pg. 74) Destructor Member Functions Inline Functions 9. Which of the following is used to free the memory space allocated as a result of object declaration? Constructor New operator Destructor (Pg. 92) Accessor Function 10. Separation of implementation from interface provides the facility to restrict the from direct access. Data member Data function Class Object (Pg. 19) 11. "This pointer" does not pass implicitly to functions. Static member (Pg. 114) Non-static member Instance member Constant member 12. In, a pointer or reference to an object is created inside a class. Aggregation (Pg. 133) Composition Separation Association 13. A class can be identified from a statement by -------------. Noun Pronoun Verb Adverb 14. By default all members of a class are, Public Protected Private Public & protected 15. Graphical representation of the classes and objects is called object model it shows -------. Class name, Attributes, States, Operations Class name, Attributes, Operations, Methods Class name, Attributes, Operations, Behaviour Class name, Attributes, Operations, Relationship 15

16. Why we should avoid the use of friend function/class? Friend function/class minimizes encapsulation Difficult to use Decreases complexity Increase program code size 17. Operator overloading is: Making C++ operators able to work with objects. Giving C++ operators more than they can handle. Giving new meanings to existing Class members. Making new C++ operators. 18. Which of the following operator can not be overloaded? Scope resolution operator ( :: ) (pg 141) Insertion operator ( << ) Extraction operator ( >> ) The relation operator ( > ) 19 Consider the following code segment: void UserInfo (Complex & C1){ C1=C1; } It is an example of: Assignment Self assignment Compound assignment Multiple assignment 20.Subscript operator must be of the class when overloaded. Static function Virtual function Member function Non member function 1. Which one of the following features of OOP is used to derive a class from another? Encapsulation Polymorphism Data hiding Inheritance (pg 25) 2. Which sentence clearly defines an object? one instance of a class. another word for a class. a class with static methods. a method that accesses class attributes. 3. If Rollno is a const data member of a class student then which definition is correct for the member function show () int show() const { return Rollno; } void show() const { return Rollno; } int show() const { return Rollno + 50; } int show(num) const { Rollno = num; } 4. Suppose that the Test class does not have an overloaded assignment operator. What happens when an assignment a=b; is given for two Test objects a and b? The automatic assignment operator is used The copy constructor is used 16

Compiler error Run-time error 5. Abstract class has. Zero Instances (there is no object) One Instance Two Instances Many Instances 6. Consider a class having name MyClass, what will be the name of this class constructor? MyClass Myclass myclass myclass 7. Which of the following is used to free the memory space allocated as a result of object declaration? Constructor New operator Destructor Accessor Function 8. The const member functions uses following specifers. Only access Only read Access and read only (Pg. 106) Access, read, and modify 9. What will be the value of the variable data and data2 respectively, If the function below is called 4 times? void func() { static int data = 4; int data2 = 4; ++data; ++data2; } 8, 5 5, 8 5, 5 7, 5 10. Object cannot be declared constant if it is required to change the state of its. Constant data members Non-constant data members Constant member functions Static data members 11. In order to free the memory occupied by the object, we use -------------. Constructor Destructor Shallow Copy 17

Deep Copy 12. The property in which existing class is modified to form a new class is called.. Polymorphism Inheritance Encapsulation Information hiding 13. In inheritance hierarchy which one is on the top? Subtyping Specialization Extension Generalization 14. Graphical representation of the classes and objects is called object model it shows -------. Class name, Attributes, States, Operations Class name, Attributes, Operations, Methods Class name, Attributes, Operations, Behaviour Class name, Attributes, Operations, Relationship 15. Why we should avoid the use of friend function/class? Friend function/class minimizes encapsulation Difficult to use Decreases complexity Increase program code size 16. In the following operators, the operator can be overloaded. % ##?:. 17. C2+C1 is equivalent to, when plus operator is overloaded, and C2, C1 are objects. C1.operator + (C2) C1.operator + (C1) C2.operator + (C1) C2.operator + (C2) 18.Consider the following code segment: void UserInfo (Complex & C1){ 18

C1=C1; } It is an example of: Assignment Self assignment Compound assignment Multiple assignment 19. To overload subscript operator, it requires one type parameter. Int Float Char String 20. Friend Complex & operator -(Complex & t); It is the declaration of: Unary minus member function Unary minus non member function (Pg. 162) Unary minus static member function Unary minus non static member function 19