/*
* Copyright ©2026 Soham Pardeshi. All rights reserved.
* Permission is hereby granted to students registered for University of
* Washington CSE 333 for use solely during Summer Quarter 2026 for
* purposes of the course. No other use, copying, distribution, or
* modification is permitted without prior written consent. Copyrights
* for third-party components of this work must be honored. Instructors
* interested in reusing these course materials should contact the author.
*/
#ifndef SIMPLEPOINT_H_
#define SIMPLEPOINT_H_
class SimplePoint {
public:
// Note that no constructors are declared/defined, so C++
// synthesizes a default constructor for us, as well as a copy
// constructor. The default constructor initializes all member
// variables with class types using their default constructors and
// sometimes, but not always, initializes member variables with
// built-in types to 0 (i.e., x_, y_). The copy constructor does a
// shallow copy of all member variables.
int get_x() const { return x_; } // inline member function
int get_y() const { return y_; } // inline member function
double Distance(const SimplePoint& p) const;
void SetLocation(int x, int y);
// Note that the "=" (assignment) operator is not overloaded,
// C++ synthesizes a default operator implementation for us
// that does a shallow copy of all member variables (x_ and y_).
private:
int x_; // data member
int y_; // data member
}; // class Point
#endif // SIMPLEPOINT_H_