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.
You might also like to view...
Answer the following statements true (T) or false (F)
1. Each column in a table must have a name. 2. When you create a database table, you must specify a data type for each column. 3. The table row designated as the primary key must hold a unique value for each column. 4. The table column designated as the primary key must hold a unique value for each row.
Pop-up Blocker is enabled by default
Indicate whether the statement is true or false
If the default border of an image hyperlink detracts from the appearance of the page, you can adjust its size with an image attribute called ____.
A. border B. link C. frame D. default
______ scanners read human characteristics such as fingerprints and retinas.
a. Biometric b. Optical c. RFID