// CSE143 Sp01 Homework 2 Sample Solution // location.h - interface to class Location, // which abstracts an location // HP 4/01 #ifndef _LOCATION_H_ #define _LOCATION_H_ #include "location.h" class Location { public: // Construct a Location with coordinates Location(double x, double y); // Default constructor - initialize this Location to <0,0> Location(); // = Distance from this Location to Location other double distanceTo(Location other); // = Direction from this Location to Location other, as a string: // north, northeast, east, southeast, south, southwest, west, northwest string directionTo(Location other); private: double x, y; // x and y coordinates of this Location }; #endif