1. Engineering
  2. Computer Science
  3. c operator overloading implement class point to pass the tests...

Question: c operator overloading implement class point to pass the tests...

Question details

C++ operator overloading-

IMPLEMENT CLASS POINT TO PASS THE TESTS-

class Point t TEST CASE Point basics, [Pointl Point pl; REQUIRE(p1.x REQUIRE (pl.y 0); 0); Point p2(1, -1); REQUIRE ( p2 . x--1 ) ; REQUIRE ( p2. y =-1 ) ; REQUIRE ( p1 + p2 = p2); REQUIRE ( p2 -p1 p2); REQUIRE (-p2 = Point (-1,1)); REQUIRE (p2 * 10 = Point (10, REQUIRE (p2 / 1 = p2); -10)); REQUIRE(p1p2) p2 += Point (1, 1); REQUIRE ( p2 . x-2 ) ; REQUIRE (p2.y 0);

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution