I need help with this Python homework about shapes, link to the assignment page is here https://sites.google.com/cs.stonybrook.edu/cse-216/assignments_1/assignment-5-oop-with-dynamic-typing
You can download the code on the page or you can also see the attached files below.
Some clarifications- in order to check equality of shapes for each class, you want them to have the same type and same coordinates. For the TwoDPoint Class,where the TODO magic method is, p is self and q is other, and adding/subtracting would mean x1-x2 and so on.
5/7/2020 CSE 216 - Assignment 5: OOP with dynamic typing https://sites.google.com/cs.stonybrook.edu/cse-216/assignments_1/assignment-5-oop-with-dynamic-typing 1/2 Assignment 5: OOP with dynamic typing This is the last assignment of the semester, and it is significantly shorter. In this assignment, you are being asked to do a few things very similar to a previous Java assignment. Specifically, there is some code being given to you for the classes being used. These are: 1. two_d_point.py 2. quadrilateral.py 3. rectangle.py 4. square.py 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 provided with 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 are encouraged to use the debugger and discover these bugs). TwoDPoint (15 points) Quadrilateral (10 points) Rectangle (15 points) Square (15 points) 2. 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 value. You must also decide if this method should be an instance, static, or class method. (21 points) 3. Every shape (i.e., quadrilateral, rectangle, and square) must also use the appropriate magic methods to CSE 216 Syllabus Lectures Assignments Recita�ons https://sites.google.com/cs.stonybrook.edu/cse-216/syllabus https://sites.google.com/cs.stonybrook.edu/cse-216/syllabus https://sites.google.com/cs.stonybrook.edu/cse-216/lectures https://sites.google.com/cs.stonybrook.edu/cse-216/assignments_1 https://sites.google.com/cs.stonybrook.edu/cse-216/recitations_1 5/7/2020 CSE 216 - Assignment 5: OOP with dynamic typing https://sites.google.com/cs.stonybrook.edu/cse-216/assignments_1/assignment-5-oop-with-dynamic-typing 2/2 check for equality and to have a human-readable string representation of an instance of the class. (24 points) Download the code. A note on Python syntax of importing modules Import 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 is from .two_d_point import TwoDPoint but it could have also been written explicitly as from just_a_folder.two_d_point import TwoDPoint Both are semantically equivalent. Implementation and submission notes Python version: 3.x. What to submit? A single .zip file comprising 1. the completed code base of the classes provided, and 2. sorter.py. Your submission should not contain any additional files. As always, make sure your code compiles and runs. Uncompilable code will not be graded. This assignment is due by May 15, 11:59 pm. © 2020 Ritwik Banerjee CSE 216 Syllabus Lectures Assignments Recita�ons https://drive.google.com/file/d/19rMCnqUFrC_f7jEBcHbAnM7qN9O8osge/view?usp=sharing https://sites.google.com/cs.stonybrook.edu/cse-216/syllabus https://sites.google.com/cs.stonybrook.edu/cse-216/syllabus https://sites.google.com/cs.stonybrook.edu/cse-216/lectures https://sites.google.com/cs.stonybrook.edu/cse-216/assignments_1 https://sites.google.com/cs.stonybrook.edu/cse-216/recitations_1