B) Create a C++ class for a two dimensional points. Write necessary member functions to accept & display the point object. Overload the following operators:
Operator Example Purpose
+ (Binary) P3=P1+P2 Adds coordinates of point pl and p2.
- (Unary) -Pl Negates coordinates of point p1.
*(Binary) P2=P1*n Multiply coordinates of point pl by constant ‘n’. [Marks 25]
BH
1 Comments
BH
ReplyDelete