
Implement coord_pair, a compact C++98 class for a pair of integer coordinates.
std::cout << (coord_pair(3, -2) + coord_pair(4, 5)) << "\n";Expected result
{7, 3}For your own tracking. Tests grade your code.
std::cout << (2 * coord_pair(-1, 6)) << "\n";Expected result
{-2, 12}Expected files
coord_pair.hppcoord_pair.cppAllowed functions
None. Write every helper yourself.
Allowed headers

v0.40: Create exercises. Challenge the community.
Meet Studio →Implement coord_pair, a compact C++98 class for a pair of integer coordinates.
std::cout << (coord_pair(3, -2) + coord_pair(4, 5)) << "\n";Expected result
{7, 3}For your own tracking. Tests grade your code.
std::cout << (2 * coord_pair(-1, 6)) << "\n";Expected result
{-2, 12}Expected files
coord_pair.hppcoord_pair.cppAllowed functions
None. Write every helper yourself.
Allowed headers

Run the tests to grade your code
Build your code, then check each test here. Open a result to inspect its output.