Write a class declaration (i.e. the full .h file) for a class that represents a point in the Cartesian plane (i.e. an x, y) coordinate * Two private data members x and y, both doubles * Constructor that takes two doubles as params * Set and Get functions for both private data members * a print member function that prints in usual ordered pair format Extra credit: (EXAM points) 1 extra credit point for a reasonable attempt (i.e. mostly on the right track) 2 for a perfect solution with no mistakes and proper use of const everywhere it is appropriate (a) Add the stuff that prevents multiple inclusion of the header file madvena 2 (b) Add the basic outline of class declaration and private data members prescott 1 cliang 1 (c) Add the function prototype for constructor dans 1 delterzo 1 (d) Add function prototype for the two set member functions nystc 1 ravedn 1 (e) Add function prototype for the two get member functions lizb 1 mrflood 1 lizb 1 for "inline" (f) Add function prototype for the print member function ksquier 2 1 nitz (for class participation) Inline functions: are member functions where the function definition, the body of the function the { } part, is right in the .h file, not in the .cc file. The compiler has the option, if the function is NOT recursive, to do a "cut and paste" of the exectuable code instead of a true function call. Advantage: speed. Avoid overhead of pushing things on the stack and popping things off the stack.. a function call can require 10s to 100s of instructions... Disadvantage: -- symbolic debugger may not be compatible with inline function expansion... (e.g. dbx a.out core technique for debugging seg faults). -- Larger executable e.g. instead of 20KB a.out might get a 20MB a.out takes more disk space takes longer to load when you type a.out take up more memory still be faster to run (once loaded) **** Aside: if you have a seg fault and need help figuring out how to debug it, look at the lecture notes from CISC105 for Fall 2005 09/19 http://copland.udel.edu/~pconrad/cisc105/05F/lect/notes/09.19/ *** Terminology Encapsulation: combining data members and member functions into one syntactic unit viz. the class. Information Hiding: internal representation of data members is hidden from users of the class. Can change representation without impacting anything outside the class (only internals of member functions would have to change). OOP: encapulsation + information hiding + inheritence + polymorphism