← Back to Classes
Question 88
Point2D Equality and Inequality (operator== and operator!=)
Point2D Equality and Inequality (operator== and operator!=)
You are checking if two points are the same location. Create a class Point2D with private ints x and y. Requirements: 1) Constructor Point2D(int x, int y) 2) Overload operator== and operator!= - Two points are equal if both x and y match Do NOT write a main function.
Expected Output:
true true
= newline. The output ends with a newline — print one after the last line.
Hints3 available
Sign in to use hintsTopics:
ClassesOperator Overloading
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cout, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.