Example #1
0
        //Purpose: returns the string represent representation of the shape
        //Requires: nothing
        //Returns: a string
        public override string ToString()
        {
            string circleSpecs;
            string centerS;

            centerS = center.toString2D();

            circleSpecs  = base.ToString() + Environment.NewLine;
            circleSpecs += "Radius: " + radius + Environment.NewLine;
            circleSpecs += "Center: " + centerS.ToString();

            return(circleSpecs);
        }
Example #2
0
        //Purpose: returns the string represent representation of the shape
        //Requires: nothing
        //Returns: a string
        public override string ToString()
        {
            string squareSpecs;
            string P1, P2, P3, P4;

            P1 = p1.toString2D();
            P2 = p2.toString2D();
            P3 = p3.toString2D();
            P4 = p4.toString2D();

            squareSpecs  = base.ToString() + Environment.NewLine;
            squareSpecs += "Length: " + length + Environment.NewLine;
            squareSpecs += "Points: P1" + P1 + " P2" + P2 + Environment.NewLine
                           + " P3" + P3 + " P4" + P4 + Environment.NewLine;

            return(squareSpecs);
        }