# L-33 MCS 260 Monday 4 April 2016 : class_point.py
"""
We define a simple class to store coordinates of a point in the plane.
The main program illustrates two instantiations.
"""

class Point(object):
    """
    Stores a point in the plane.
    """
    def __init__(self, x=0, y=0):
        """
        Defines the coordinates.
        """
        self.xpt = x
        self.ypt = y

    def __str__(self):
        """
        Returns the string representation.
        """
        return '(' + str(self.xpt) \
                   + ', ' \
                   + str(self.ypt) + ')'

    def __repr__(self):
        """
        Returns the representation.
        """
        return self.__str__()

def main():
    """
    Instantiates two points.
    """
    print('instantiating two points ...')
    first = Point()
    print('p =', first)
    second = Point(3, 4)
    print('q =', second)

if __name__ == "__main__":
    main()
