Chapter8 - Chapter 8 OBJECT ORIENTED PROGRAMMING I SOME...

Info icon This preview shows pages 1–17. Sign up to view the full content.

View Full Document Right Arrow Icon
Chapter 8 OBJECT ORIENTED PROGRAMMING - I
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
2 SOME DEFINITIONS OOP - Object Oriented Programming OBJECT - A collection of descriptive data and the functions to manipulate the data, all in a self- contained package. CLASS - The declaration statement that C++ uses to define objects. In a class statement you define the data members and member functions of an object. ENCAPSULATION - The binding data & methods (variables & functions) to create an object.
Image of page 2
3 SOME DEFINITIONS DATA ABSTRACTION - The hiding of the specific form that the data of an object is stored from the user of the object. The user of an object uses the object via the member functions and does not care how the hidden or private data is stored. CONSTRUCTOR - A function that creates an instantiation of an object and assigns values to its data members. In C++, constructor functions have the same name as the object. DESTRUCTOR - A function that releases dynamic memory of an instantiated object. A destructor is not required if the object did not allocate dynamic memory. In C++, destructor function names start with a tilda, “~”, and end with the name of the object.
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
4 POINT OBJECT EXAMPLE Class Definition {
Image of page 4
5 POINT OBJECT EXAMPLE Member Variables {
Image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
6 POINT OBJECT EXAMPLE Member Functions (Methods) {
Image of page 6
7 POINT OBJECT EXAMPLE Constructor Implementation {
Image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
8 POINT OBJECT EXAMPLE Constructor Implementation {
Image of page 8
9 POINT OBJECT EXAMPLE Print Function Implementation {
Image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
10 POINT OBJECT EXAMPLE x y p1 1.5 4
Image of page 10
11 POINT OBJECT EXAMPLE x y x y p1 p2 1.5 4 0 0
Image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
12 POINT OBJECT EXAMPLE x y x y p1 p2 1.5 4 0 0
Image of page 12
13 POINT OBJECT EXAMPLE x y x y p1 p2 1.5 4 0 0
Image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
14 POINT OBJECT EXAMPLE x y x y p1 p2 1.5 4 0 0
Image of page 14
15 POINT OBJECT EXAMPLE x y x y p1 p2 1.5 4
Image of page 15

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
16 POINT OBJECT EXAMPLE x y x y p1 p2 1.5 4 1.5
Image of page 16
Image of page 17
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern