When you define a C++ class so that the result is an ADT, which of the following remarks about whether to make a member variable or function public or private are correct?

a) Make them all public. It simplifies life and makes things more efficient to be able
access members anywhere.
b) Don’t make member variables public.
c) Make all member functions public.
d) There are some member functions that shouldn’t be public, but most should be
public.

Probably b) is correct, see Explanations. d) is correct.

Computer Science & Information Technology

You might also like to view...

Errors in a program can be classified into three types, list them

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Action buttons are predesigned shapes to which you can add hyperlinks.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology