Class Members Interactions

Regardless of how the member methods of an object are implemented, any method can call another without using an access operator. This allows an object?s methods to exchange information among themselves easily. Furthermore, unlike regular functions where a function must be declared prior to another function calling it, the method members of a class do not abide by that rule: one method can call another method before or after the other has been implemented, as long as it is defined somewhere.

Once an object is defined and behaves as complete as possible, the other function or objects of the program can make the appropriate calls trusting that the called object can handle its assignments efficiently. This ability allows you to (tremendously) reduce the work overload of the other components of a program.

The main() function can simply call the appropriate member of the ShoeBox object now: