Question: Q1 Using the UML class diagram to write OOP Python code for class with suitable overloading function, volume, and display function. Also, in the main
Q1 Using the UML class diagram to write OOP Python code for class with suitable overloading function, volume, and display function. Also, in the main code part write all needed code to create cl , c2,c3, Also, display should print out [ Cube Side=?? , the Volume=??? ] for display of c1, c2 . c3 ....etc. UML class diagram Cube - side: float (private) c1 a=2 c2 a=3 c3 = c1** c2 > + __init_(in a ): void a +_pow_lin self, other): object + volume(self): float + display ...)void cube volume= side x side x side Q2 Using following code, What is the best Comparison Operator to create the object ( 53 ) from calling the less than overloading function, according to the following Python code? Hint: s3 should be out from the comparison between the area of (si) and ( 52 ), the s3 will be the one with smallest area. And in the main code, how you can call this Comparison Operator to create the object ( 53 ) class Square: def_init__(self, a = 0): self side = a def area(self): return self side **2 def display(self): print("Area="self.areal)," side="self.side) def... #main code s1 = Square(4) 52 = Square(3)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
