Your tasks are as follows:1. Complete the codebase for TwoDPoint, Quarilateral, Rectangle, and Square. The incomplete portions of the code are marked with TODO and the methods are providedwith documentation explaining what each incomplete method should do. There may also be a few minor bugs in the provided code. It is a part of this assignment to fix these (you areencouraged to use the debugger and discover these bugs by use of unit tests, if necessary).TwoDPointQuadrilateralRectangleSquare2. Write a class called ShapeSorter (the file name must be sorter.py) with a method called sort. This method should take as its argument a variable number of quadrilaterals(i.e., *args) and return a list of these shapes sorted in increasing order of their smallest x-coordinate. You must also decide if this method should be an instance, static, or classmethod.3. Every shape (i.e., quadrilateral, rectangle, and square) must also use the appropriate magic methods to check for equality and to have a human-readable string representation of aninstance of the class. These must be the standard usage of Pythons magic methods, and NOT something else.4. Complete the unit tests provided in the classes TestTwoDPoint and TestQuadrilateral.5. Write unit test classes TestRectangle and TestSquare. In these classes, you must write unit test methods for Rectangles center() and area() methods, and Squaressnap() method.The code base is available here.For this assignment, you may assume that all shapes have sides that are axis-aligned. For example, rectangles and squares will have sides that are parallel to the x and y axes. This doesnot, of course, make sense for quadrilaterals in general.A note on Python syntax of importing modulesImport statements in Python can be absolute or relative (recall that the dot-based syntax in import statements are translated to paths. So, for two files in the same package or folder,you may use either option. For example, the import statement in quadrilateral.py isfrom .two_d_point import TwoDPointbut it could have also been written explicitly asfrom just_a_folder.two_d_point import TwoDPointBoth are semantically equivalen
Only logged in customers who have purchased this product may leave a review.
Reviews
There are no reviews yet.