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

True /False 13. _There is only one copy of the class\'s member func- tions and t

ID: 3732762 • Letter: T

Question

True /False 13. _There is only one copy of the class's member func- tions and that copy is shared among all the class's objects 14. Putting class definition in a separate file (e-g. head- er) makes it easy to reuse. 15. _A private data member of a class can usually be accessed from outside the class. 16. A member function of a class can call other private member functions of the same class. 17. _A destructor function can have parameters. 18. _A class can have objects of other classes as data members. 19. The following code is valid: int x-5 f (ptr!- mullptr) cout

Explanation / Answer

Hi..

13. There is only one copy of the classs member functions and that copy is shared among all the class objects.

Ans: False

for each object it maintains diffrent.

14. Putting class definition in a seperate file (e.g header) makes it easy to reuse.

Ans: True.

15. A private data member of class can usually be accessed from outside the class.

Ans: False.

with use of getter and setters we can access the variables.

16. A member function of a class can call other private member functions of the same class.

Ans: False.

17. A destructor function can have parameters.

Ans: False.
we can simply call ~class name().

18. A class can have objects of other classses as data members.

Ans: False.

19. The following code is valid.

int x=5;
int *ptr = &x;
if(ptr!=null)
cout << "Not Null";

Output:
It prints not null as output console.

true (valid)

20. The following code is valid:

int x=5;
int *const ptr = &x;
*ptr = 7;

Ans: Not valid

int *const ptr = &x;

Please check the above and let me know any issues. Thank you. All the best.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote