How to program ?
Posted on 2000-04-23
Design a class called Tvcctor with two private data members x and y to represent vector of two components as follow :
the class should have a default constructor to initialize both data members to zero, a general constructor to initialize both data members to given values on declaration and a copy constructor to initialize one object from another on declarationl;
the class should also have a member function set() to assign given values to the two data members.
Declare a vector class object a with the default constructor, declare another class object b with the general constructor, and initialize a third class object c with b.