Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

public: acint f this-1-1 int maino t cout com.i 2 9. What is the advantage of a)

ID: 3907366 • Letter: P

Question

public: acint f this-1-1 int maino t cout com.i 2 9. What is the advantage of a) data encapsulation using classes? Answer b) a convenient way of modeling real world objects c) simplifying code reuse d) all above answers Answer 10. What value must a destructor) an object of the class return? b) does not return a value c) a status code determining whether the class was destructed correctly a pointer to the class d) TI. Which of the following is) class can have member functions while structure cannot Answer correct about class and b) class data members are public by default while that of structure? structure are private c) pointer to structure or classes cannot be declared d) class data members are private by default while that of structure are public by default 12 Which feature of the a) polymorphism gives the concept of late binding b) encapsulation of function call? Answer: c) inheritance d) none of the above 13 Choose the option applicable a) cannot be called explicity for the constructor. Answer: b) cannot be overloaded c) cannot be overridden d) none of the above 4 Which of the following a) return type ermits function overloading on b) number of arguments c) type of argument d) b) and c) Which of the following is not a) member function ved to be overloaded Answer b) constructor c) destructor d) none of the above Quiz 2 June 21,

Explanation / Answer

9.all the above statements are true .(option is d)

10.destructor does not return a value.Destructors: Do not accept arguments. Cannot specify any return type(including void ). Cannot return a value using the return statement.

11.option d is correct. Class data members are private by default where as structure data members are public by default

12.polymorphism

Late Binding : (Run time polymorphism)In this, the compiler adds code that identifies the kind of object at runtime then matches the call with the right function definition

13.the constructors cannot be overridden in c++

14.answer is b&c both the no arguments and type of argument

15.answer is c.the destructor cannot be overloaded.The reason why you can't overload adestructor is because your code wouldn't have a clue about whichdestructor it needs to call when you destroy an object.

Hope this will help

Please do rate