/* This is an example of the OO- STYLE of design. Several features are to be noted: (a) Physical modules: 3 file file1 = application (client): vectorapp.cpp file2 = vector class interface: vector.h file3 = vector class implementation: vector.cpp (b) Logical modules: 2 - client application: main() - vector class is a private type with 17 methods; (c) Language supported class used: ifstream, ofstream. (d) Application defined classes: Vector. (e) Data encapsulation used: YES The class Vector IS encapsulated in its own physical modules (vector.h and vector.cpp). (f) Information hiding used: Complete!!!!! In reference to type Vector we note the following: - The representation of the type is NO LONGER visible and accessable to the client code. - The client CANNOT explicitly reference or access the internal components of type Vector (x,y). - The parsing of vectors on input is provided by special input methods, Getpolar() and Getcart(). Consequently, the external format or syntax of vectors on input streams is completely encapsulated in the Vector class and hidden from the client - the client simply does not need to know this format. - In general, information hiding is complete in this style. The C++ language prevents malicious or accidental access to the internal representation of Vector instances. (g) Decomposition stype: - 1 Functional Client, - 3 Object-oriented Classes (h) Degree of OO'ness: - Variables (fin)(fout)are used to denote io-stream objects. Methods used: open(), close(), eof(), <<, >>. - Within a single instance of a "problem," Vector variables A1,D1,U1,A2,D2,U2, X1,X2, Q1, and Q2 are actual instances of class Vector - they are bonafide objects. In the C versions, these variables were not viewed in quite the same way. - The dynamic creation of Vector objects is accomplished using constructor methods. The automatic recovery of storage allocated to Vector instances is built into C++ via calls to destructor methods defined for the class (~Vector). */