def main():

   # create object of class Cylinder
   cylinder = Cylinder( 12, 23, 2.5, 5.7 )

   # print Cylinder attributes
   print("X coordinate is:", cylinder.x)
   print("Y coordinate is:", cylinder.y)
   print("Radius is:", cylinder.radius)
   print("Height is:", cylinder.height)

   # change Cylinder attributes
   cylinder.height = 10
   cylinder.radius = 4.25
   cylinder.x, cylinder.y = 2, 2
   print("\nThe new points, radius and height of cylinder are:", \
      cylinder)

   print("\nThe area of cylinder is: %.2f" % cylinder.area())

   # display the Cylinder as a Point
   print("\ncylinder printed as a Point is:", \
      Point.__str__( cylinder ))

   # display the Cylinder as a Circle
   print("\ncylinder printed as a Circle is:", \
      Circle.__str__( cylinder ))
Exemple #2
0
def main():

   # create object of class Cylinder
   cylinder = Cylinder( 12, 23, 2.5, 5.7 )

   # print Cylinder attributes
   print "X coordinate is:", cylinder.x
   print "Y coordinate is:", cylinder.y
   print "Radius is:", cylinder.radius
   print "Height is:", cylinder.height

   # change Cylinder attributes
   cylinder.height = 10
   cylinder.radius = 4.25
   cylinder.x, cylinder.y = 2, 2
   print "\nThe new points, radius and height of cylinder are:", \
      cylinder

   print "\nThe area of cylinder is: %.2f" % cylinder.area()

   # display the Cylinder as a Point
   print "\ncylinder printed as a Point is:", \
      Point.__str__( cylinder )

   # display the Cylinder as a Circle
   print "\ncylinder printed as a Circle is:", \
      Circle.__str__( cylinder )
Exemple #3
0
def main():
    circle = Circle(37, 43, 2.5)

    print("X coordinate is", circle.x)
    print("Y coordinate is", circle.y)
    print("Radius is:", circle.radius)

    circle.radius = 4.25
    circle.x = 2
    circle.y = 2

    print("The new location and radius of circle are:", circle)
    print("The area of circle is: %.2f" % circle.area())

    print("circle printed as a Point is:", Point.__str__(circle))
Exemple #4
0
def main():
   circle = Circle( 37, 43, 2.5 )  # create Circle object

   # print circle attributes
   print "X coordinate is:", circle.x
   print "Y coordinate is:", circle.y
   print "Radius is:", circle.radius

   # change circle attributes and print new values
   circle.radius = 4.25
   circle.x = 2
   circle.y = 2

   print "\nThe new location and radius of circle are:", circle
   print "The area of circle is: %.2f" % circle.area()

   print "\ncircle printed as a Point is:", Point.__str__( circle )
def main():
    circle = Circle(37, 43, 2.5)  # create Circle object

    # print circle attributes
    print("X coordinate is:", circle.x)
    print("Y coordinate is:", circle.y)
    print("Radius is:", circle.radius)

    # change circle attributes and print new values
    circle.radius = 4.25
    circle.x = 2
    circle.y = 2

    print("\nThe new location and radius of circle are:", circle)
    print("The area of circle is: %.2f" % circle.area())

    print("\ncircle printed as a Point is:", Point.__str__(circle))
Exemple #6
0
def main():

	cylinder =Cylinder(23,4,3.4,5.4)

	print "The X coordinate is:", cylinder.x
	print "The y coordinate is:", cylinder.y
	print "Radius is:", cylinder.radius
	print "Heigt is:", cylinder.height

	cylinder.height = 10
	cylinder.radius = 4.25
	cylinder.x, cylinder.y = 2, 3

	print "\nThe new point, radius and height of cylinder are:", cylinder
	print "\nThe area of cylinder is: %.2f" %cylinder.area()
	print "\ncylinder printed as a point is:", Point.__str__(cylinder)
	print "\ncylinder printed as a Circle is:", Circle.__str__(cylinder)
Exemple #7
0
   def __init__( self, x = 0, y = 0, radiusValue = 0.0 ):
      """Circle constructor takes center point and radius"""

      Point.__init__( self, x, y )  # call base-class constructor
      self.radius = float( radiusValue )
Exemple #8
0
   def __str__( self ):
      """String representation of a Circle"""

      # call base-class __str__ method
      return "Center = %s Radius = %f" % \
         ( Point.__str__( self ), self.radius )
    def __init__(self, x=0, y=0, radiusValue=0.0):
        """Circle constructor takes center point and radius"""

        Point.__init__(self, x, y)  # call base-class constructor
        self.radius = float(radiusValue)
    def __str__(self):
        """String representation of a Circle"""

        # call base-class __str__ method
        return "Center = %s Radius = %f" % \
           ( Point.__str__( self ), self.radius )
Exemple #11
0
 def SetAtributes(self, color, startPx, startPy, data):
     self.SetColor(color)
     self.startPoint = Point(startPx, startPy)
     self.radius = float(data[0])
Exemple #12
0
 def SetAtributes(self, color, startPx, startPy, data):
     self.SetColor(color)
     self.startPoint = Point(startPx, startPy)
     self.secPoint = Point(data[0], data[1])
Exemple #13
0
 def __init__(self, x=0, y=0, radiusValue=0.0):
     Point.__init__(self, x, y)
     self.radius = float(radiusValue)
Exemple #14
0
 def __str__(self):
     return "Center  = %s Radius = %f" % \
         (Point.__str__(self), self.radius)