Question: OBJECT ORIENTED PROGRAMMING C++ OBJECT ORIENTED PROGRAMMING C++ CLO 1 20 Marks 1. Operator overloading is a. giving C++ operators more than they can handle.

OBJECT ORIENTED PROGRAMMING C++

OBJECT ORIENTED PROGRAMMING C++ OBJECT ORIENTED PROGRAMMING C++ CLO 1 20 Marks

1. Operator overloading is a. giving C++ operators more than they can

handle. b. giving new meanings to existing C++ operators. C. making new

OBJECT ORIENTED PROGRAMMING C++

CLO 1 20 Marks 1. Operator overloading is a. giving C++ operators more than they can handle. b. giving new meanings to existing C++ operators. C. making new C++ operators. 2. How many arguments are required in the definition of an overloaded unary operator? 3. Assuming that class X does not use any overloaded operators, write a statement that adds an object of class X, x1, to another such object, x2, and places the result in x3. obj1 - obj2; to work 4. Assume a class C with objects obj1, obj2, and obj3. For the statement obj3 correctly, the overloaded - operator must take two arguments. b. return a value. create a named temporary object. a. C. 5. To convert from a user-defined class to a basic type, you would most likely use a. a built-in conversion operator. b. a one-argument constructor. C. a conversion operator that's a member of the class. 6. True or False: The statement objA = objB; will cause a compiler error if the objects are of different classes. 7. To convert from a basic type to a user-defined class, you would most likely use a built-in conversion operator. Page 1 of 4 a. b. a one-argument constructor. a conversion operator that's a member of the class. c. 8. Inheritance is a way to a. Pass arguments to objects of classes. b. Add features to existing classes without rewriting them. c. Improve data hiding and encapsulation. 9. If a base class and a derived class each include a member function with the same name, which member function will be called by an object of the derived class, assuming the scope-resolution operator is not used? 10. Assume that there is a class Dery that is derived from a base class Base. Write the declarator for a derived-class constructor that takes one argument and passes this argument along to the constructor in the Base class. 11. Assume a class Dery that is privately derived from class Base. An object of class Derv located in main() can access private members of Derv. b. protected members of Derv. C. public members of Derv. a. a. 12. A class hierarchy describes "has a" relationships. b. describes "is a kind of relationships. shows the same relationships as a family tree. c. a. 13. Aggregation is a stronger form of generalization. b. a stronger form of composition. a "has a relationship. C. a. 14. Virtual functions allow you to use the same function call to execute member functions of objects from different classes. b. create an array of type pointer-to-base class that can hold pointers to derived classes. C. group objects of different classes so they can all be accessed by the same function code. 15. True or false: A pointer to a base class can point to objects of a derived class. Page 2 of 4 16. 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 virtual member function, ding(), the statement p->ding(); will cause the version of ding() in the class to be executed. 17. 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. 18. A pure virtual function is a virtual function that a. returns nothing. b. is used in a derived class. C. causes its class to abstract. 19. A pointer is a. a variable for storing addresses. b. the address of a variable. C. an indication of the variable to be accessed next. 20. What is Late Binding

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!