If this is a homework assignment, please consider trying to answer it yourself first, otherwise the value of the reinforcement of the lesson offered by the assignment will be lost on you.
To hide the data in a class in C++, simply declare the data private, and then manipulate the data using the public interface of the class.
Chat with our AI personalities
link list
Data hiding is a property that only relevant information is exposed to the user and rest of the informations remains hidden from the user
Public members in C++ have accessibility to any function that has scope to the instance of the class, whereas private members have accessibility only to functions of that class.
6
b+b+b+c+c+c+c =3b+4c