CS304 Object Oriented Programming

Size: px
Start display at page:

Download "CS304 Object Oriented Programming"

Transcription

1 1 CS304 Object Oriented Programming 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 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

2 Destructor (pg 81) Accessor Function 7. and methods may not be declared abstract. 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 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_ 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) 2

3 A operator(a &obj3); 15. Abstract classes have..object/s, while concrete classes have..object/s. One, One More than one, more than one 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 3 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 CS304 Object Oriented Programming 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

4 The copy constructor is used Compiler error Run-time error 3. By default, which access level is assigned to members of a class? 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 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 4

5 5 Null 11. Which one is not keyword in C++? operator 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. 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

6 20. operator will take only one operand. New Const Int This CS304 Object Oriented Programming 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. 6

7 7 Simple Complex Strong (Pg. 53) Weak 7. Consider a class having name MyClass, what will be the name of this class constructor? 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(); 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

8 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 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 CS304 Object Oriented Programming 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 8

9 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? 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) 9

10 10 Static member 9. The return type of a constructor is of Integer Character Double No type (Pg. 74) 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

11 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) 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 CS304 Object Oriented Programming 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 11

12 Aggregation Association Abstraction 4. Which of the following is directly related to polymorphism? 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 12

13 In, a pointer or reference to an object is created inside a class. Aggregation (Pg. 134) Composition Separation Association 11. Identify which of the following overloaded operator function s declaration is appropriate for the given call? Rational_number_ 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.

14 Only one per class. One object per variable. 18. We change the evaluation precedence of operators through operator overloading. 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 CS304 Object Oriented Programming 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 14

15 Two less Three most 6. Which of the following is a weak relationship between two objects? Inheritance Composition Aggregation 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, 15

16 16 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 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 CS304 Object Oriented Programming 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.

17 17 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 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

18 18 7, 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 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. % ##?:.

19 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){ 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 MCQz (Set-1) 1. We can get only one unique value which can be used by all the objects of that class by The use of, Static variables Dynamic variables Instance variables Data members A member function having the same name as that of a class and a ~ sign with it is called, Constructor Getter Setter Destructor

20 3. Using encapsulation we can achieve Information hiding Least interdependencies among modules Implementation independence All of given options 4. Inheritance is a way to make general classes into more specific classes. Pass arguments to objects of classes. Improve data hiding and encapsulation. Providing class growth through natural selection. 5. Static variable can be initialized more than once. True False 6. for classes with common behavior, you can save effort by placing the common behavior in a. Derived Class Base class Deprived Class Named class 7. Which of the following are advantages of OOP? OOP makes it easy to re-use the code It provides an ability to create one user defined data type by extending the other It provides the facility of defining Abstract data types through which real world entities can be defined better All of the given options 8. The >= operator can be overloaded. True False 9. A static member function cannot be declared. Static Implicit Explicit Virtual 10. Static variables act like a global variable in the context or scope of the class. True 20

21 False 11. The compiler won t object if you overload the * operator to perform division. True False 12. We can use "this" pointer in the constructor in the body and even in the initialization list of any class if we are careful, TRUE False 13. A C++ class is similar to Structure Header File Library File None of the given 14. Which operator can not be overloaded? The relation operator ( >= ) Assignment operator ( = ) Script operator ( [] ) Conditional operator (? : ), Ternary Operator 15. An overloaded operator always requires one less argument than its number of operands. True False 16. A generalization-specialization relation between classes are implemented using Data hiding Friend classes Encapsulation Inheritance 16. In OOP a class is an example of Data Type Abstract Type User Defined Type None of the given 21

22 17. Identify which of the following overloaded operator function s declaration is appropriate for the given call? Rational_number_ Where Rational_number_1 is an object of user defined class Rational_number. Rational_number operator+( Rational_number & obj); Rational_number operator+(double& obj); 18. Rational_number operator+(rational_number &obj, double& num); operator+(double& obj); A class can be identified from a statement by Noun Pronoun Verb Adverb 19. The members of a class that can be accessed without creating the object of the class is called Private member Data Member Public Member Static MCQz (Set-2) Question No: 1 (Marks: 1) - Please choose one Suppose there is an object of type Person, which of the following can be considered as one of its attributes Name Age Work() Both Name and Age Question No: 2 ( Marks: 1 ) - Please choose one What a derived class can add? New data members New member functions and New friend functions New constructors and destructor All of given Question No: 3 ( Marks: 1 ) - Please choose one is/are used to access information hidden within an object? Interface Private data members Private member functions Both public and private members 22

23 Question No: 4 ( Marks: 1 ) - Please choose one this pointers are not accessible for static member functions. True False Question No: 5 ( Marks: 1 ) - Please choose one A static member function cannot be declared. Static Implicit Explicit Virtual Question No: 6 ( Marks: 1 ) - Please choose one C++ compiler does not allow to dynamically allocate memory for objects False True Question No: 7 ( Marks: 1 ) - Please choose one 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 Question No: 8 ( Marks: 1 ) - Please choose one Friend class and friend function can be used as an alternate to each other True False Question No: 9 ( Marks: 1 ) - Please choose one Which of the following operators always takes no argument if overloaded? / Question No: 10 ( Marks: 1 ) - Please choose one 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 23

24 Question No: 11 ( Marks: 1 ) - Please choose one 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 Question No: 12 ( Marks: 1 ) - Please choose one Which operator can not be overloaded? The relation operator ( >= ) Assignment operator ( = ) Script operator ( [] ) Conditional operator (? : ) Question No: 13 ( Marks: 1 ) - Please choose one We achieve independence of internal implementation from its external interface through Encapsulation Information Hiding Abstraction both encapsulation and information hiding Question No: 14 ( Marks: 1 ) - Please choose one Which one of the following is not an object association? Simple Association Inheritance Aggregation Composition Question No: 15 (Marks: 1) - Please choose one We capture the object attributes and behavior in Object Oriented programming using Class Function Data Members Instances Question No: 16 (Marks: 1) - Please choose one The return type of a constructor is of Integer Character Double No type pg 74 24

25 In constant member function the type of this pointer is: 1. Constant pointer Constant pointer to object 2. Constant pointer to class 3. Constant pointer to constant object Which of the following is the way to extract common behavior and attributes from the given classes and make a separate class of those common behaviors and attributes? Generalization 1. Sub-typing 2. Specialization 3. Extension The ability to derive a class from more than one class is called 1. Single inheritance 2. Encapsulation Multiple inheritances 3. Polymorphism If MyClass has a destructor what is the destructor named? 1. MyClass ~MyClass 2. My~Class 3. MyClass~ Class abc{ ; Is a valid class declaration? Yes No Without using Deep copy constructor, A problem can occur 1. System crash 2. Memory Leakage 3. Dangling pointer All of the given If only one behaviors of a derived class is incompatible with base class, then it is: 1. Generalization Specialization 2. Extension 3. Inheritance Which of the following may not be an integral part of an object? 1. State 2. Behavior Protected data members 3. All of given 25

26 Only tangible things can be chosen as an object. 1. True False MCQz (Set-5) Question # 1 of 10 ( Start time: 09:26:23 PM ) Total Marks: 1 Consider the code below, class class1{ public: void func1(); ; class class2 : protected class1 { ; Function func1 of class1 is in class2, public protected private none of the given options Question # 2 of 10 ( Start time: 09:27:52 PM ) Total Marks: 1 In case of dynamic memory allocation in a class we should use, User defined default constructor User defined copy constructor Both of these None of these Question # 3 of 10 ( Start time: 09:29:20 PM ) Total Marks: 1 Consider the code below, class class1{ protected: int i; ; class class2 : public class1 { ; Then int member i of class1 is in class2, public protected private none of the given options Question # 4 of 10 ( Start time: 09:30:13 PM ) Total Marks: 1 In private inheritance derived class pointer can be assigned to base class pointer in, Main function In derived class member and friend functions In base class member and friend functions None of the given options Question # 5 of 10 ( Start time: 09:31:42 PM ) Total Marks: 1 Child class can call constructor of its, Direct base class pg 209 Indirect base class Both direct and indirect base classes None of these Question # 6 of 10 ( Start time: 09:31:59 PM ) Total Marks: 1 Consider the following two lines of code written for a class Student, 1. Student 26

27 sobj1,sobj2; 2. sobj2 = sobj1; In line No.2 what constructor of Student class will be called, Default constructor of Student class. Copy constructor of student class Both default and copy constructer of Student class No constructor will be called. 27 Question # 7 of 10 (Start time: 09:33:17 PM) Total Marks: 1 Consider the code below, class class1{ public: int i; ; class class2 : public class1 { ; Then int member i of class1 is in class2, Public Protected Private None of the given options Question # 8 of 10 ( Start time: 09:33:54 PM ) Total Marks: 1 We can call base class constructor from derived class constructor, From derived class constructor body From the initialized list of derived class constructor From any member function of derived class We can not call the base class constructor Question # 9 of 10 ( Start time: 09:35:20 PM ) Total Marks: 1 Adding a derived class to a base class requires fundamental changes to the base class. True False Question # 10 of 10 ( Start time: 09:36:44 PM ) Total Marks: 1 Public Inheritance represents, IS A relationship Has A relationship IS Special Kind of relationship None of these options MCQz (Set-9) Question No: 1 (Marks: 1) - Please choose one A template provides a convenient way to make a family of Variables and data members Functions and classes Classes and exceptions Programs and algorithms Question No: 2 ( Marks: 1 ) - Please choose one

28 Which one of the following terms must relate to polymorphism? Static allocation Static typing Dynamic binding Dynamic allocation Question No: 3 ( Marks: 1 ) - Please choose one What is true about function templates? The compiler generates only one copy of the function template The compiler generates a copy of function respective to each type of data The compiler can only generate copy for the int type data None of the given. Question No: 4 ( Marks: 1 ) - Please choose one Which of the following is the best approach if it is required to have more than onefunctions having exactly same functionality and implemented on different data types? Templates Overloading Data hiding Encapsulation Question No: 5 ( Marks: 1 ) - Please choose one template <> class Vector<char*> { This is an example of partial specialization. True False Question No: 6 ( Marks: 1 ) - Please choose one Classes like TwoDimensionalShape and ThreeDimensionalShape would normally be concrete, while classes like Sphere and Cube would normally be abstract. True False Question No: 7 ( Marks: 1 ) - Please choose one A non-virtual member function is defined in a base class and overridden in a derived class; if that function is called through a base-class pointer to a derived class object, the derived-class version is used. True False Question No: 8 ( Marks: 1 ) - Please choose one Assume a class Derv that is privately derived from class Base. An object of class Derv located in main() can access public members of Derv. protected members of Derv. private members of Derv. protected members of Base. 28

29 Question No: 9 ( Marks: 1 ) - Please choose one In order to define a class template, the first line of definition must be: template <typename T> typename <template T> Template Class <ClassName> Class <Template T> Question No: 10 ( Marks: 1 ) - Please choose one If there is a pointer p to objects of a base class, and it contains the address of an object of a derived class, and both classes contain a nonvirtual member function, ding(), then the statement p->ding(); will cause the version of ding() in the class to be executed. Base Derived Abstract virtual Question No: 11 ( Marks: 1 ) - Please choose one When the base class and the derived class have a member function with the same name, you must be more specific which function you want to call (using ). scope resolution operator dot operator null operator Operator overloading Question No: 12 ( Marks: 1 ) - Please choose one Non Template Friend functions of a class are friends of instance/s of that class. All One specific All instances of one date type None of the given options Question No: 13 ( Marks: 1 ) - Please choose one The find() algorithm finds matching sequences of elements in two containers. finds a container that matches a specified container. takes iterators as its first two arguments. takes container elements as its first two arguments. Question No: 14 ( Marks: 1 ) - Please choose one If you define a vector v with the default constructor, and define another vector w with a one-argument constructor to a size of 11, and insert 3 elements into each of these vectors with push_back(), then the size() member function will return for v and for w. 11 for v and 3 for w. 0 for v and 0 for w. 0 for v and 3 for w. 3 for v and 11 for w. Question No: 15 ( Marks: 1 ) - Please choose one 29

30 Which of the following may not be an integral part of an object? State Behavior Protected data members All of given Question No: 16 ( Marks: 1 ) - Please choose one Which is not the Advantage of inheritance? providing class growth through natural selection. facilitating class libraries. avoiding the rewriting of code. providing a useful conceptual framework. Question No: 17 ( Marks: 1 ) - Please choose one class DocElement { public: virtual void Print() { cout << "Generic element"; ; class Heading : public DocElement { public: void Print() { cout << "Heading element"; ; class Paragraph : public DocElement { public: void Print() { cout << "Paragraph element"; ; void main() { DocElement * p = new Paragraph(); p->print(); When you run this program, it will print out a single line to the console output. What will be in that line? Select one correct answer from the following list: Generic element Heading element Paragraph element Nothing will be printed. Question No: 18 ( Marks: 1 ) - Please choose one When a virtual function is called by referencing a specific object by name and using the dot member selection operator (e.g., squareobject.draw()), the reference is resolved at compile time. True False 30

31 Question No: 19 ( Marks: 1 ) - Please choose one In case of multiple inheritance a derived class inherits, Only the public member functions of its base classes Only the public data members of its base classes Both public data members and member functions of all its base classes Data members and member functions of any two base classes Question No: 20 ( Marks: 1 ) - Please choose one When we write a class template the first line must be: template < class class_name> template < class data_type> template < class T > Here T can be replaced with any name but it is preferable. class class-name() class template<class_name> Question No: 21 ( Marks: 1 ) - Please choose one Which of the following is incorrect line regarding function template? template<class T> template <typename U> Class<template T> template < class T, class U> Question No: 22 ( Marks: 1 ) - Please choose one An STL container can not be used to, hold objects of class employee. store elements in a way that makes them quickly accessible. compile c++ programs. organize the way objects are stored in memory Question No: 23 ( Marks: 1 ) - Please choose one Algorithms can only be implemented using STL containers. True False Question No: 24 ( Marks: 1 ) - Please choose one Consider a class named Vehicle, which of the following can be the instance of class Vehicle? 1. Car 2. Computer 3. Desk 4. Ahmed 5. Bicycle 6. Truck 1, 4, 5 2, 5, 6 1, 2, 3, 6 1, 5, 6 31

32 Question No: 25 ( Marks: 1 ) - Please choose one Consider the code below, class Fred { public: Fred();... ; int main() { Fred a[10]; Fred* p = new Fred[10];... Select the best option, Fred a[10]; calls the default constructor 09 times Fred* p = new Fred[10]; calls the default constructor 10 times Produce an error Fred a[10]; calls the default constructor 11 times Fred* p = new Fred[10]; calls the default constructor 11 times Fred a[10]; calls the default constructor 10 times Fred* p = new Fred[10]; calls the default constructor 10 times Question No: 26 ( Marks: 1 ) - Please choose one When a variable is define as static in a class then all object of this class, Have different copies of this variable Have same copy of this variable Can not access this variable None of given Question No: 27 ( Marks: 1 ) - Please choose one The life of sub object is dependant on the life of master class in. Separation Composition Aggregation None of the given Question No: 28 ( Marks: 1 ) - Please choose one, 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 Friendship is two way only NO Friendship between classes Any kind of friendship Question No: 29 ( Marks: 1 ) - Please choose one Which of the following operators always takes no argument if overloaded? /

33 ++ Question No: 30 ( Marks: 1 ) - Please choose one In Private only member functions and friend classes or functions of a derived class can convert pointer or reference of derived object to that of parent object specialization inheritance abstraction composition MCQz (Set-11) Question # 1 of 10 ( Start time: 08:40:52 AM ) Total Marks: 1 Outside world can access only members of a class using its object. Public Private Protected No member is accessible. Question # 2 of 10 ( Start time: 08:41:55 AM ) Total Marks: 1 Consider the code below, class class1{ private: int i; ; class class2 : protected class1 { ; Then int member i of class1 is in class2, public protected private none of the given options Question # 4 of 10 ( Start time: 08:44:20 AM ) Total Marks: 1 In Public Inheritance the public members of base class become in derived class. Public Private Protected None of the given options. Question # 5 of 10 ( Start time: 08:45:35 AM ) Total Marks: 1 Consider the code below, class class1{ protected: int i; ; class class2 : public class1 { ; Then int member i of class1 is in class2, public protected private none of the given options Question No: 1 ( Marks: 1 ) - Please choose one Which one of the following terms must relate to polymorphism? 33

34 Static allocation Static typing Dynamic binding Dynamic allocation Question No: 2 ( Marks: 1 ) - Please choose one Multiple inheritance can be of type Public Private Protected All of the given Question No: 3 ( Marks: 1 ) - Please choose one When a subclass specifies an alternative definition for an attribute or method of its superclass, it is the definition in the superclass. overload overriding copy riding none of given Question No: 4 ( Marks: 1 ) - Please choose one Like template functions, a class template may not handle all the types successfully. True False Question No: 5 ( Marks: 1 ) - Please choose one It is sometimes useful to specify a class from which no objects will ever be created. True False Question No: 6 ( Marks: 1 ) - Please choose one Assume a class Derv that is privately derived from class Base. An object of class Derv located in main() can access public members of Derv. protected members of Derv. private members of Derv. protected members of Base. Question No: 7 ( Marks: 1 ) - Please choose one A pointer to a base class can point to objects of a derived class. True False Question No: 8 ( Marks: 1 ) - Please choose one A copy constructor is invoked when a function do not returns by value. an argument is passed by value. a function returns by reference. an argument is passed by reference. 34

35 Question No: 9 ( Marks: 1 ) - Please choose one A function call is resolved at run-time in non-virtual member function. virtual member function. Both non-virtual member and virtual member function. None of given Question No: 10 ( Marks: 1 ) - Please choose one When the base class and the derived class have a member function with the same name, you must be more specific which function you want to call (using ). scope resolution operator dot operator null operator Operator overloading Question No: 11 ( Marks: 1 ) - Please choose one Each try block can have no. of catch blocks As many as necessary. Question No: 12 ( Marks: 1 ) - Please choose one Two important STL associative containers are and. set,map sequence,mapping setmet,multipule sit,mat Question No: 13 ( Marks: 1 ) - Please choose one The mechanism of selecting function at run time according to the nature of calling object is called, late binding static binding virtual binding None of the given options Question No: 14 ( Marks: 1 ) - Please choose one An abstract class is useful when, We do not derive any class from it. There are multiple paths from one derived class to another. We do not want to instantiate its object. You want to defer the declaration of the class. Question No: 15 ( Marks: 1 ) - Please choose one Which of the following is incorrect line regarding function template? template<class T> template <typename U> 35

36 Class<template T> template < class T, class U> Question No: 16 ( Marks: 1 ) - Please choose one Which of the following is/are advantage[s] of generic programming? Reusability Writability Maintainability All of given Question No: 17 ( Marks: 1 ) - Please choose one By default the vector data items are initialized to null Question No: 18 ( Marks: 1 ) - Please choose one Which one of the following functions returns the total number of elements in a vector. length(); size(); ele(); veclen(); Question No: 19 ( Marks: 1 ) - Please choose one Suppose you create an uninitialized vector as follows: vector<int> evec; After adding the statment, evec.push_back(21); what will happen? The following statement will add an element to the start (the back) of evec and will initialize it with the value 21. The following statement will add an element to the center of evec and will reinitialize it with the value 21. The following statement will delete an element to the end (the back) of evec and will reinitialize it with the value 21. The following statement will add an element to the end (the back) of evec and initialize it with the value 21. Question No: 20 ( Marks: 1 ) - Please choose one An STL container can not be used to, hold objects of class employee. store elements in a way that makes them quickly accessible. compile c++ programs. organize the way objects are stored in memory Question No: 21 ( Marks: 1 ) - Please choose one Algorithms can only be implemented using STL containers. 36

37 True False Question No: 22 ( Marks: 1 ) - Please choose one The main function of scope resolution operator (::) is, To define an object To define a data member To link the definition of an identifier to its declaration To make a class private Question No: 23 ( Marks: 1 ) - Please choose one When is a constructor called? Each time the constructor identifier is used in a program statement During the instantiation of a new object During the construction of a new class At the beginning of any program execution Question No: 24 ( Marks: 1 ) - Please choose one Consider the code below, class Fred { public: Fred();... ; int main() { Fred a[10]; Fred* p = new Fred[10];... Select the best option, Fred a[10]; calls the default constructor 09 times Fred* p = new Fred[10]; calls the default constructor 10 times Produce an error Fred a[10]; calls the default constructor 11 times Fred* p = new Fred[10]; calls the default constructor 11 times Fred a[10]; calls the default constructor 10 times Fred* p = new Fred[10]; calls the default constructor 10 times Question No: 25 ( Marks: 1 ) - Please choose one Associatively can be changed in operator overloading. True False Question No: 26 ( Marks: 1 ) - Please choose one A normal C++ operator that acts in special ways on newly defined data types is said to be glorified. encapsulated. 37

38 classified. overloaded. Question No: 27 ( Marks: 1 ) - Please choose one Which operator can not be overloaded? The relation operator ( >= ) Assignment operator ( = ) Script operator ( [] ) Conditional operator (? : ) Question No: 28 ( Marks: 1 ) - Please choose one 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) (); A operator(a &obj3); Question No: 29 ( Marks: 1 ) - Please choose one Default constructor is such constructor which either has no or if it has some parameters these have values Parameter, temporary Null, Parameter Parameter, default non of the given Question No: 30 ( Marks: 1 ) - Please choose one Public methods of base class can be accessed in its derived class directly inderectly simultaniously non of the given Question No: 31 ( Marks: 1 ) Is Deque a Birectional Container? Yes, deque behaves like queue (line) such that we can add elements on both sides of it. Question No: 32 ( Marks: 1 ) What is meant by Generic Programming? Generic programming refers to programs containing generic abstractions general code that is same in logic for all data types like printarray function), then we instantiate that generic program abstraction (function, class) for a particular data type, such abstractions can work with many different types of data. Question # 1 of 10 Information hiding can be achieved through. 1.Encapsulation, Inheritance 2.Encapsulation, Polymorphism 38

39 3.Encapsulation, Abstraction 4.Overloading Question # 2 of 10 ( Start time: 01:11:21 AM ) Total Marks: 1 A good model is... related to a real life problem. 1.Loosely 2.Openly 3.Closely Question # 3 of 10 ( Start time: 01:12:33 AM ) Total Marks: 1 Which of the following features of OOP is used to derive a class from another? 1.Encapsulation 2.Polymorphism 3.Data hiding 4. Inheritance Question # 4 of 10 ( Start time: 01:13:51 AM ) Total Marks: 1 Which of the following is a weak relationship between two objects? 1. Inheritance 2.Composition 3. Aggregation 4. None of given Question # 5 of 10 ( Start time: 01:14:56 AM ) Total Marks: 1 Data items in a class must be private. 1. True 2. False Question # 7 of 10 ( Start time: 01:16:55 AM ) Total Marks: 1 Suppose there is an object of type Person, which of the following can be considered as one of its attributes 1. Name 2. Age 3. Work () 4. Both Name and Age Question # 8 of 10 ( Start time: 01:17:52 AM ) Total Marks: 1 Which one is not an object association? 1. Simple association 2. Inheritance 3. Aggregation 4. Association 39

CS304 Object Oriented Programming Final Term

CS304 Object Oriented Programming Final Term 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

More information

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

CS304- Object Oriented Programming LATEST SOLVED MCQS FROM FINALTERM PAPERS. MC CS304- Object Oriented Programming LATEST SOLVED MCQS FROM FINALTERM PAPERS JAN 28,2011 MC100401285 Moaaz.pk@gmail.com Mc100401285@gmail.com PSMD01 FINALTERM EXAMINATION 14 Feb, 2011 CS304- Object Oriented

More information

FINAL TERM EXAMINATION SPRING 2010 CS304- OBJECT ORIENTED PROGRAMMING

FINAL TERM EXAMINATION SPRING 2010 CS304- OBJECT ORIENTED PROGRAMMING FINAL TERM EXAMINATION SPRING 2010 CS304- OBJECT ORIENTED PROGRAMMING Question No: 1 ( Marks: 1 ) - Please choose one Classes like TwoDimensionalShape and ThreeDimensionalShape would normally be concrete,

More information

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

OBJECT ORIENTED PROGRAMMING USING C++ CSCI Object Oriented Analysis and Design By Manali Torpe OBJECT ORIENTED PROGRAMMING USING C++ CSCI 5448- Object Oriented Analysis and Design By Manali Torpe Fundamentals of OOP Class Object Encapsulation Abstraction Inheritance Polymorphism Reusability C++

More information

What are the characteristics of Object Oriented programming language?

What are the characteristics of Object Oriented programming language? What are the various elements of OOP? Following are the various elements of OOP:- Class:- A class is a collection of data and the various operations that can be performed on that data. Object- This is

More information

Programming, numerics and optimization

Programming, numerics and optimization Programming, numerics and optimization Lecture A-4: Object-oriented programming Łukasz Jankowski ljank@ippt.pan.pl Institute of Fundamental Technological Research Room 4.32, Phone +22.8261281 ext. 428

More information

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

OOPS Viva Questions. Object is termed as an instance of a class, and it has its own state, behavior and identity. OOPS Viva Questions 1. What is OOPS? OOPS is abbreviated as Object Oriented Programming system in which programs are considered as a collection of objects. Each object is nothing but an instance of a class.

More information

Chapter 5 Object-Oriented Programming

Chapter 5 Object-Oriented Programming Chapter 5 Object-Oriented Programming Develop code that implements tight encapsulation, loose coupling, and high cohesion Develop code that demonstrates the use of polymorphism Develop code that declares

More information

Short Notes of CS201

Short Notes of CS201 #includes: Short Notes of CS201 The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with < and > if the file is a system

More information

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

JAYARAM COLLEGE OF ENGINEERING AND TECHNOLOGY Pagalavadi, Tiruchirappalli (An approved by AICTE and Affiliated to Anna University) Estd: 1994 JAYARAM COLLEGE OF ENGINEERING AND TECHNOLOGY Pagalavadi, Tiruchirappalli - 621014 (An approved by AICTE and Affiliated to Anna University) ISO 9001:2000 Certified Subject Code & Name : CS 1202

More information

CS201 - Introduction to Programming Glossary By

CS201 - Introduction to Programming Glossary By CS201 - Introduction to Programming Glossary By #include : The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with

More information

CLASSES AND OBJECTS IN JAVA

CLASSES AND OBJECTS IN JAVA Lesson 8 CLASSES AND OBJECTS IN JAVA (1) Which of the following defines attributes and methods? (a) Class (b) Object (c) Function (d) Variable (2) Which of the following keyword is used to declare Class

More information

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

Object Oriented Programming. Assistant Lecture Omar Al Khayat 2 nd Year Object Oriented Programming Assistant Lecture Omar Al Khayat 2 nd Year Syllabus Overview of C++ Program Principles of object oriented programming including classes Introduction to Object-Oriented Paradigm:Structures

More information

Object-Oriented Design (OOD) and C++

Object-Oriented Design (OOD) and C++ Chapter 2 Object-Oriented Design (OOD) and C++ At a Glance Instructor s Manual Table of Contents Chapter Overview Chapter Objectives Instructor Notes Quick Quizzes Discussion Questions Projects to Assign

More information

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

Jayaram college of Engineering and Technology, Pagalavadi. CS2203 Object Oriented Programming Question Bank Prepared By: S.Gopalakrishnan, Lecturer/IT CS2203 Object Oriented Programming Question Bank Prepared By: S.Gopalakrishnan, Lecturer/IT Two Mark Questions UNIT - I 1. DEFINE ENCAPSULATION. Encapsulation is the process of combining data and functions

More information

Instantiation of Template class

Instantiation of Template class Class Templates Templates are like advanced macros. They are useful for building new classes that depend on already existing user defined classes or built-in types. Example: stack of int or stack of double

More information

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

Intro to OOP Visibility/protection levels and constructors Friend, convert constructor, destructor Operator overloading a<=b a. Intro to OOP - Object and class - The sequence to define and use a class in a program - How/when to use scope resolution operator - How/when to the dot operator - Should be able to write the prototype

More information

Object-Oriented Programming (OOP) Fundamental Principles of OOP

Object-Oriented Programming (OOP) Fundamental Principles of OOP Object-Oriented Programming (OOP) O b j e c t O r i e n t e d P r o g r a m m i n g 1 Object-oriented programming is the successor of procedural programming. The problem with procedural programming is

More information

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

OBJECT ORIENTED PROGRAMMING. Ms. Ajeta Nandal C.R.Polytechnic,Rohtak OBJECT ORIENTED PROGRAMMING Ms. Ajeta Nandal C.R.Polytechnic,Rohtak OBJECT ORIENTED PARADIGM Object 2 Object 1 Data Data Function Function Object 3 Data Function 2 WHAT IS A MODEL? A model is an abstraction

More information

Object-Oriented Programming

Object-Oriented Programming - oriented - iuliana@cs.ubbcluj.ro Babes-Bolyai University 2018 1 / 56 Overview - oriented 1 2 -oriented 3 4 5 6 7 8 Static and friend elements 9 Summary 2 / 56 I - oriented was initially created by Bjarne

More information

Department of Computer science and Engineering Sub. Name: Object oriented programming and data structures Sub. Code: EC6301 Sem/Class: III/II-ECE Staff name: M.Kavipriya Two Mark Questions UNIT-1 1. List

More information

Data Structures using OOP C++ Lecture 3

Data Structures using OOP C++ Lecture 3 References: th 1. E Balagurusamy, Object Oriented Programming with C++, 4 edition, McGraw-Hill 2008. 2. Robert L. Kruse and Alexander J. Ryba, Data Structures and Program Design in C++, Prentice-Hall 2000.

More information

Cpt S 122 Data Structures. Course Review Midterm Exam # 2

Cpt S 122 Data Structures. Course Review Midterm Exam # 2 Cpt S 122 Data Structures Course Review Midterm Exam # 2 Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Midterm Exam 2 When: Monday (11/05) 12:10 pm -1pm

More information

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

I BSc(IT) [ Batch] Semester II Core: Object Oriented Programming With C plus plus - 212A Multiple Choice Questions. Dr.G.R.Damodaran College of Science (Autonomous, affiliated to the Bharathiar University, recognized by the UGC)Reaccredited at the 'A' Grade Level by the NAAC and ISO 9001:2008 Certified CRISL rated 'A'

More information

C++ Important Questions with Answers

C++ Important Questions with Answers 1. Name the operators that cannot be overloaded. sizeof,.,.*,.->, ::,? 2. What is inheritance? Inheritance is property such that a parent (or super) class passes the characteristics of itself to children

More information

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

C++ (Non for C Programmer) (BT307) 40 Hours C++ (Non for C Programmer) (BT307) 40 Hours Overview C++ is undoubtedly one of the most widely used programming language for implementing object-oriented systems. The C++ language is based on the popular

More information

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

Data Structures (list, dictionary, tuples, sets, strings) Data Structures (list, dictionary, tuples, sets, strings) Lists are enclosed in brackets: l = [1, 2, "a"] (access by index, is mutable sequence) Tuples are enclosed in parentheses: t = (1, 2, "a") (access

More information

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

+2 Volume II OBJECT TECHNOLOGY OBJECTIVE QUESTIONS R.Sreenivasan SanThome HSS, Chennai-4. Chapter -1 Chapter -1 1. Object Oriented programming is a way of problem solving by combining data and operation 2.The group of data and operation are termed as object. 3.An object is a group of related function

More information

Absolute C++ Walter Savitch

Absolute C++ Walter Savitch Absolute C++ sixth edition Walter Savitch Global edition This page intentionally left blank Absolute C++, Global Edition Cover Title Page Copyright Page Preface Acknowledgments Brief Contents Contents

More information

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

KOM3191 Object Oriented Programming Dr Muharrem Mercimek OPERATOR OVERLOADING. KOM3191 Object-Oriented Programming KOM3191 Object Oriented Programming Dr Muharrem Mercimek 1 OPERATOR OVERLOADING KOM3191 Object-Oriented Programming KOM3191 Object Oriented Programming Dr Muharrem Mercimek 2 Dynamic Memory Management

More information

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

Cpt S 122 Data Structures. Introduction to C++ Part II Cpt S 122 Data Structures Introduction to C++ Part II Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Topics Objectives Defining class with a member function

More information

Object-Oriented Programming

Object-Oriented Programming Object-Oriented Programming 1. What is object-oriented programming (OOP)? OOP is a technique to develop logical modules, such as classes that contain properties, methods, fields, and events. An object

More information

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

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING CS6456 OBJECT ORIENTED PROGRAMMING DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING CS6456 OBJECT ORIENTED PROGRAMMING Unit I : OVERVIEW PART A (2 Marks) 1. Give some characteristics of procedure-oriented

More information

Page No.1. CS304 OOP_ Muhammad Ishfaq

Page No.1. CS304 OOP_ Muhammad Ishfaq Page No.1 File Version Update: (Dated: 21-May-2011) This version of file contains: Content of the Course (Done) FAQ updated version.(these must be read once because some very basic definition and question

More information

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

Learning Objectives. C++ For Artists 2003 Rick Miller All Rights Reserved xli Identify and overcome the difficulties encountered by students when learning how to program List and explain the software development roles played by students List and explain the phases of the tight spiral

More information

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

OBJ. ORI.& MULT. PROG., M.C.Q. BANK, FOR UNIT -2, SECOND YEAR COMP. ENGG. SEM-4, 2012 PATTERN, U.O.P. UNIT-2 UNIT-2 Syllabus for Unit-2 Introduction, Need of operator overloading, overloading the assignment, binary and unary operators, overloading using friends, rules for operator overloading, type conversions

More information

Interview Questions of C++

Interview Questions of C++ Interview Questions of C++ Q-1 What is the full form of OOPS? Ans: Object Oriented Programming System. Q-2 What is a class? Ans: Class is a blue print which reflects the entities attributes and actions.

More information

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

Overview of OOP. Dr. Zhang COSC 1436 Summer, /18/2017 Overview of OOP Dr. Zhang COSC 1436 Summer, 2017 7/18/2017 Review Data Structures (list, dictionary, tuples, sets, strings) Lists are enclosed in square brackets: l = [1, 2, "a"] (access by index, is mutable

More information

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

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub Lebanese University Faculty of Science Computer Science BS Degree Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub 2 Crash Course in JAVA Classes A Java

More information

COEN244: Class & function templates

COEN244: Class & function templates COEN244: Class & function templates Aishy Amer Electrical & Computer Engineering Templates Function Templates Class Templates Outline Templates and inheritance Introduction to C++ Standard Template Library

More information

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

Object Oriented Programming is a programming method that combines: Advantage of Object Oriented Programming Overview of OOP Object Oriented Programming is a programming method that combines: a) Data b) Instructions for processing that data into a self-sufficient object that can be used within a program or in

More information

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

Lecture 3. COMP1006/1406 (the Java course) Summer M. Jason Hinek Carleton University Lecture 3 COMP1006/1406 (the Java course) Summer 2014 M. Jason Hinek Carleton University today s agenda assignments 1 (graded) & 2 3 (available now) & 4 (tomorrow) a quick look back primitive data types

More information

CMSC 132: Object-Oriented Programming II

CMSC 132: Object-Oriented Programming II CMSC 132: Object-Oriented Programming II Java Support for OOP Department of Computer Science University of Maryland, College Park Object Oriented Programming (OOP) OO Principles Abstraction Encapsulation

More information

STRUCTURING OF PROGRAM

STRUCTURING OF PROGRAM Unit III MULTIPLE CHOICE QUESTIONS 1. Which of the following is the functionality of Data Abstraction? (a) Reduce Complexity (c) Parallelism Unit III 3.1 (b) Binds together code and data (d) None of the

More information

CS304 Lecture Wise Questions by Virtualians Social

CS304 Lecture Wise Questions by Virtualians Social Lecture No 1: What is Object-oriented programming (OOP)? Object-oriented programming (OOP) is a programming paradigm using "objects" data structures consisting of data fields and methods together with

More information

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

CMSC 202 Section 010x Spring Justin Martineau, Tuesday 11:30am CMSC 202 Section 010x Spring 2007 Computer Science II Final Exam Name: Username: Score Max Section: (check one) 0101 - Justin Martineau, Tuesday 11:30am 0102 - Sandeep Balijepalli, Thursday 11:30am 0103

More information

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

Paytm Programming Sample paper: 1) A copy constructor is called. a. when an object is returned by value Paytm Programming Sample paper: 1) A copy constructor is called a. when an object is returned by value b. when an object is passed by value as an argument c. when compiler generates a temporary object

More information

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

I BCS-031 BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination. June, 2015 BCS-031 : PROGRAMMING IN C ++ No. of Printed Pages : 3 I BCS-031 BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination 05723. June, 2015 BCS-031 : PROGRAMMING IN C ++ Time : 3 hours Maximum Marks : 100 (Weightage 75%)

More information

Object Oriented Programming. Solved MCQs - Part 2

Object Oriented Programming. Solved MCQs - Part 2 Object Oriented Programming Solved MCQs - Part 2 Object Oriented Programming Solved MCQs - Part 2 It is possible to declare as a friend A member function A global function A class All of the above What

More information

Chapter 11. Categories of languages that support OOP: 1. OOP support is added to an existing language

Chapter 11. Categories of languages that support OOP: 1. OOP support is added to an existing language Categories of languages that support OOP: 1. OOP support is added to an existing language - C++ (also supports procedural and dataoriented programming) - Ada 95 (also supports procedural and dataoriented

More information

CS201 Latest Solved MCQs

CS201 Latest Solved MCQs Quiz Start Time: 09:34 PM Time Left 82 sec(s) Question # 1 of 10 ( Start time: 09:34:54 PM ) Total Marks: 1 While developing a program; should we think about the user interface? //handouts main reusability

More information

C++ & Object Oriented Programming Concepts The procedural programming is the standard approach used in many traditional computer languages such as BASIC, C, FORTRAN and PASCAL. The procedural programming

More information

AN OVERVIEW OF C++ 1

AN OVERVIEW OF C++ 1 AN OVERVIEW OF C++ 1 OBJECTIVES Introduction What is object-oriented programming? Two versions of C++ C++ console I/O C++ comments Classes: A first look Some differences between C and C++ Introducing function

More information

Weiss Chapter 1 terminology (parenthesized numbers are page numbers)

Weiss Chapter 1 terminology (parenthesized numbers are page numbers) Weiss Chapter 1 terminology (parenthesized numbers are page numbers) assignment operators In Java, used to alter the value of a variable. These operators include =, +=, -=, *=, and /=. (9) autoincrement

More information

Data type of a pointer must be same as the data type of the variable to which the pointer variable is pointing. Here are a few examples:

Data type of a pointer must be same as the data type of the variable to which the pointer variable is pointing. Here are a few examples: Unit IV Pointers and Polymorphism in C++ Concepts of Pointer: A pointer is a variable that holds a memory address of another variable where a value lives. A pointer is declared using the * operator before

More information

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

Day 4. COMP1006/1406 Summer M. Jason Hinek Carleton University Day 4 COMP1006/1406 Summer 2016 M. Jason Hinek Carleton University today s agenda assignments questions about assignment 2 a quick look back constructors signatures and overloading encapsulation / information

More information

Chapter 1: Object-Oriented Programming Using C++

Chapter 1: Object-Oriented Programming Using C++ Chapter 1: Object-Oriented Programming Using C++ Objectives Looking ahead in this chapter, we ll consider: Abstract Data Types Encapsulation Inheritance Pointers Polymorphism Data Structures and Algorithms

More information

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

3.Constructors and Destructors. Develop cpp program to implement constructor and destructor. 3.Constructors and Destructors Develop cpp program to implement constructor and destructor. Constructors A constructor is a special member function whose task is to initialize the objects of its class.

More information

CS260 Intro to Java & Android 03.Java Language Basics

CS260 Intro to Java & Android 03.Java Language Basics 03.Java Language Basics http://www.tutorialspoint.com/java/index.htm CS260 - Intro to Java & Android 1 What is the distinction between fields and variables? Java has the following kinds of variables: Instance

More information

Get Unique study materials from

Get Unique study materials from Downloaded from www.rejinpaul.com VALLIAMMAI ENGNIEERING COLLEGE SRM Nagar, Kattankulathur 603203. DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Year & Semester : IV Section : EEE - 1 & 2 Subject Code

More information

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

MaanavaN.Com CS1203 OBJECT ORIENTED PROGRAMMING DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING SUB CODE / SUBJECT: CS1203 / Object oriented programming YEAR / SEM: II / III QUESTION BANK UNIT I FUNDAMENTALS PART-A (2 MARKS) 1. What is Object Oriented

More information

Java Object Oriented Design. CSC207 Fall 2014

Java Object Oriented Design. CSC207 Fall 2014 Java Object Oriented Design CSC207 Fall 2014 Design Problem Design an application where the user can draw different shapes Lines Circles Rectangles Just high level design, don t write any detailed code

More information

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

Quiz Start Time: 09:34 PM Time Left 82 sec(s) Quiz Start Time: 09:34 PM Time Left 82 sec(s) Question # 1 of 10 ( Start time: 09:34:54 PM ) Total Marks: 1 While developing a program; should we think about the user interface? //handouts main reusability

More information

Module Operator Overloading and Type Conversion. Table of Contents

Module Operator Overloading and Type Conversion. Table of Contents 1 Module - 33 Operator Overloading and Type Conversion Table of Contents 1. Introduction 2. Operator Overloading 3. this pointer 4. Overloading Unary Operators 5. Overloading Binary Operators 6. Overloading

More information

Chapter 6 Introduction to Defining Classes

Chapter 6 Introduction to Defining Classes Introduction to Defining Classes Fundamentals of Java: AP Computer Science Essentials, 4th Edition 1 Objectives Design and implement a simple class from user requirements. Organize a program in terms of

More information

SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR

SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR 603203 DEPARTMENT OF COMPUTER SCIENCE & APPLICATIONS QUESTION BANK (2017-2018) Course / Branch : M.Sc CST Semester / Year : EVEN / II Subject Name

More information

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

Object Oriented Programming in Java. Jaanus Pöial, PhD Tallinn, Estonia Object Oriented Programming in Java Jaanus Pöial, PhD Tallinn, Estonia Motivation for Object Oriented Programming Decrease complexity (use layers of abstraction, interfaces, modularity,...) Reuse existing

More information

Kapil Sehgal PGT Computer. Science Ankleshwar Gujarat

Kapil Sehgal PGT Computer. Science Ankleshwar Gujarat Classes Chapter 4 Classes and Objects Data Hiding and Encapsulation Function in a Class Using Objects Static Class members Classes Class represents a group of Similar objects A class is a way to bind the

More information

Data Abstraction. Hwansoo Han

Data Abstraction. Hwansoo Han Data Abstraction Hwansoo Han Data Abstraction Data abstraction s roots can be found in Simula67 An abstract data type (ADT) is defined In terms of the operations that it supports (i.e., that can be performed

More information

VALLIAMMAI ENGINEERING COLLEGE

VALLIAMMAI ENGINEERING COLLEGE VALLIAMMAI ENGINEERING COLLEGE SRM Nagar, Kattankulathur 603 203 DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING QUESTION BANK B.E. - Electrical and Electronics Engineering IV SEMESTER CS6456 - OBJECT ORIENTED

More information

CS 6456 OBJCET ORIENTED PROGRAMMING IV SEMESTER/EEE

CS 6456 OBJCET ORIENTED PROGRAMMING IV SEMESTER/EEE CS 6456 OBJCET ORIENTED PROGRAMMING IV SEMESTER/EEE PART A UNIT I 1. Differentiate object oriented programming from procedure oriented programming. 2. Define abstraction and encapsulation. 3. Differentiate

More information

Introduction to Programming Using Java (98-388)

Introduction to Programming Using Java (98-388) Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;

More information

CPS 506 Comparative Programming Languages. Programming Language

CPS 506 Comparative Programming Languages. Programming Language CPS 506 Comparative Programming Languages Object-Oriented Oriented Programming Language Paradigm Introduction Topics Object-Oriented Programming Design Issues for Object-Oriented Oriented Languages Support

More information

OBJECT ORİENTATİON ENCAPSULATİON

OBJECT ORİENTATİON ENCAPSULATİON OBJECT ORİENTATİON Software development can be seen as a modeling activity. The first step in the software development is the modeling of the problem we are trying to solve and building the conceptual

More information

CS 162, Lecture 25: Exam II Review. 30 May 2018

CS 162, Lecture 25: Exam II Review. 30 May 2018 CS 162, Lecture 25: Exam II Review 30 May 2018 True or False Pointers to a base class may be assigned the address of a derived class object. In C++ polymorphism is very difficult to achieve unless you

More information

Zhifu Pei CSCI5448 Spring 2011 Prof. Kenneth M. Anderson

Zhifu Pei CSCI5448 Spring 2011 Prof. Kenneth M. Anderson Zhifu Pei CSCI5448 Spring 2011 Prof. Kenneth M. Anderson Introduction History, Characteristics of Java language Java Language Basics Data types, Variables, Operators and Expressions Anatomy of a Java Program

More information

Fast Introduction to Object Oriented Programming and C++

Fast Introduction to Object Oriented Programming and C++ Fast Introduction to Object Oriented Programming and C++ Daniel G. Aliaga Note: a compilation of slides from Jacques de Wet, Ohio State University, Chad Willwerth, and Daniel Aliaga. Outline Programming

More information

Inheritance, and Polymorphism.

Inheritance, and Polymorphism. Inheritance and Polymorphism by Yukong Zhang Object-oriented programming languages are the most widely used modern programming languages. They model programming based on objects which are very close to

More information

2 ADT Programming User-defined abstract data types

2 ADT Programming User-defined abstract data types Preview 2 ADT Programming User-defined abstract data types user-defined data types in C++: classes constructors and destructors const accessor functions, and inline functions special initialization construct

More information

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

(5 2) Introduction to Classes in C++ Instructor - Andrew S. O Fallon CptS 122 (February 7, 2018) Washington State University (5 2) Introduction to Classes in C++ Instructor - Andrew S. O Fallon CptS 122 (February 7, 2018) Washington State University Key Concepts Function templates Defining classes with member functions The Rule

More information

Programming II (CS300)

Programming II (CS300) 1 Programming II (CS300) Chapter 05: Inheritance and Interfaces MOUNA KACEM mouna@cs.wisc.edu Fall 2018 Inheritance and Interfaces 2 Introduction Inheritance and Class Hierarchy Polymorphism Abstract Classes

More information

CS105 C++ Lecture 7. More on Classes, Inheritance

CS105 C++ Lecture 7. More on Classes, Inheritance CS105 C++ Lecture 7 More on Classes, Inheritance " Operator Overloading Global vs Member Functions Difference: member functions already have this as an argument implicitly, global has to take another parameter.

More information

IS0020 Program Design and Software Tools Summer, 2004 August 2, 2004 in Class

IS0020 Program Design and Software Tools Summer, 2004 August 2, 2004 in Class IS0020 Program Design and Software Tools Summer, 2004 August 2, 2004 in Class Name: A. Fill in the blanks in each of the following statements [Score: 20]: 1. A base class s members can be accessed only

More information

Introduction Of Classes ( OOPS )

Introduction Of Classes ( OOPS ) Introduction Of Classes ( OOPS ) Classes (I) A class is an expanded concept of a data structure: instead of holding only data, it can hold both data and functions. An object is an instantiation of a class.

More information

END TERM EXAMINATION

END TERM EXAMINATION END TERM EXAMINATION THIRD SEMESTER [BCA] DECEMBER 2007 Paper Code: BCA 209 Subject: Object Oriented Programming Time: 3 hours Maximum Marks: 75 Note: Attempt all questions. Internal choice is indicated.

More information

C++ Programming: Polymorphism

C++ Programming: Polymorphism C++ Programming: Polymorphism 2018 년도 2 학기 Instructor: Young-guk Ha Dept. of Computer Science & Engineering Contents Run-time binding in C++ Abstract base classes Run-time type identification 2 Function

More information

RAJIV GANDHI COLLEGE OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF INFORMATION TECHNOLOGY OBJECT ORIENTED PROGRAMMING QUESTION BANK UNIT I 2 MARKS

RAJIV GANDHI COLLEGE OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF INFORMATION TECHNOLOGY OBJECT ORIENTED PROGRAMMING QUESTION BANK UNIT I 2 MARKS RAJIV GANDHI COLLEGE OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF INFORMATION TECHNOLOGY OBJECT ORIENTED PROGRAMMING YEAR/SEM:II & III UNIT I 1) Give the evolution diagram of OOPS concept. 2) Give some

More information

III. Classes (Chap. 3)

III. Classes (Chap. 3) III. Classes III-1 III. Classes (Chap. 3) As we have seen, C++ data types can be classified as: Fundamental (or simple or scalar): A data object of one of these types is a single object. int, double, char,

More information

Basics of Object Oriented Programming. Visit for more.

Basics of Object Oriented Programming. Visit   for more. Chapter 4: Basics of Object Oriented Programming Informatics Practices Class XII (CBSE Board) Revised as per CBSE Curriculum 2015 Visit www.ip4you.blogspot.com for more. Authored By:- Rajesh Kumar Mishra,

More information

Ch. 12: Operator Overloading

Ch. 12: Operator Overloading Ch. 12: Operator Overloading Operator overloading is just syntactic sugar, i.e. another way to make a function call: shift_left(42, 3); 42

More information

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

Abstract Data Types (ADTs) 1. Legal Values. Client Code for Rational ADT. ADT Design. CS 247: Software Engineering Principles Abstract Data Types (ADTs) CS 247: Software Engineering Principles ADT Design An abstract data type (ADT) is a user-defined type that bundles together: the range of values that variables of that type can

More information

Computer Science II (20073) Week 1: Review and Inheritance

Computer Science II (20073) Week 1: Review and Inheritance Computer Science II 4003-232-01 (20073) Week 1: Review and Inheritance Richard Zanibbi Rochester Institute of Technology Review of CS-I Hardware and Software Hardware Physical devices in a computer system

More information

STUDY NOTES UNIT 1 - INTRODUCTION TO OBJECT ORIENTED PROGRAMMING

STUDY NOTES UNIT 1 - INTRODUCTION TO OBJECT ORIENTED PROGRAMMING OBJECT ORIENTED PROGRAMMING STUDY NOTES UNIT 1 - INTRODUCTION TO OBJECT ORIENTED PROGRAMMING 1. Object Oriented Programming Paradigms 2. Comparison of Programming Paradigms 3. Basic Object Oriented Programming

More information

COMPUTER PROGRAMMING (ECE 431) TUTORIAL 9

COMPUTER PROGRAMMING (ECE 431) TUTORIAL 9 COMPUTER PROGRAMMING (ECE 431) TUTORIAL 9 1. What is object oriented programming (OOP)? How is it differs from the traditional programming? 2. What is a class? How a class is different from a structure?

More information

CS6301 PROGRAMMING AND DATA STRUCTURES II QUESTION BANK UNIT-I 2-marks ) Give some characteristics of procedure-oriented language. Emphasis is on doing things (algorithms). Larger programs are divided

More information

M301: Software Systems & their Development. Unit 4: Inheritance, Composition and Polymorphism

M301: Software Systems & their Development. Unit 4: Inheritance, Composition and Polymorphism Block 1: Introduction to Java Unit 4: Inheritance, Composition and Polymorphism Aims of the unit: Study and use the Java mechanisms that support reuse, in particular, inheritance and composition; Analyze

More information

Cmpt 135 Assignment 2: Solutions and Marking Rubric Feb 22 nd 2016 Due: Mar 4th 11:59pm

Cmpt 135 Assignment 2: Solutions and Marking Rubric Feb 22 nd 2016 Due: Mar 4th 11:59pm Assignment 2 Solutions This document contains solutions to assignment 2. It is also the Marking Rubric for Assignment 2 used by the TA as a guideline. The TA also uses his own judgment and discretion during

More information

Object Oriented Programming with c++ Question Bank

Object Oriented Programming with c++ Question Bank Object Oriented Programming with c++ Question Bank UNIT-1: Introduction to C++ 1. Describe the following characteristics of OOP. i Encapsulation ii Polymorphism, iii Inheritance 2. Discuss function prototyping,

More information

Operator overloading

Operator overloading 1 Introduction 2 The copy constructor 3 Operator Overloading 4 Eg 1: Adding two vectors 5 The -> operator 6 The this pointer 7 Overloading = 8 Unary operators 9 Overloading for the matrix class 10 The

More information

BCS THE CHARTERED INSTITUTE FOR IT. BCS HIGHER EDUCATION QUALIFICATIONS BCS Level 5 Diploma in IT OBJECT ORIENTED PROGRAMMING

BCS THE CHARTERED INSTITUTE FOR IT. BCS HIGHER EDUCATION QUALIFICATIONS BCS Level 5 Diploma in IT OBJECT ORIENTED PROGRAMMING BCS THE CHARTERED INSTITUTE FOR IT BCS HIGHER EDUCATION QUALIFICATIONS BCS Level 5 Diploma in IT OBJECT ORIENTED PROGRAMMING Wednesady 23 rd March 2016 Afternoon Answer any FOUR questions out of SIX. All

More information