Sample Essays & Free Papers For You

A reliable academic resource for high school and college students.
Essay database with free papers will provide you with original and creative ideas.

C++ Review Topics

Date Submitted: 01/12/2002 17:28:46
Length: 12 pages (3282 words)
Views: 79175

C++ fully supports object-oriented programming which includes the following: Encapsulation is the property of being a self-contained unit. With encapsulation we can accomplish data hiding. Data hiding is the highly valued characteristic that an object can be used without the user knowing or caring how it works internally. C++ supports the properties of encapsulation through the creation of user-defined types, called classes. Inheritance allows for the extension of an existing type. The new subclass derives …

Is this essay helpful? Join now to read this particular paper and access over 480,000 just like it!

…data private: unsigned int itsAge; unsigned int itsWeight; }; The above class has five public methods. There are accessor functions GetAge and SetAge for itsWeight. These accessor functions set the member variables and return their values. The public member function Meow() is not an accessor function--it doesn't get or set a member variable. To set Frisky's age, you would pass the value to the SetAge method as in: Cat Frisky; Frisky.SetAge(5); //uses public accessor function

Need a unique paper?