Complete the codebase for TwoDPoint, Quarilateral, Rectangle, and The incomplete portions of the code are marked with TODO and the methods are provided with documentation explaining
INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS
Assignment 5: Object-oriented programming and unit testing in Python
There is some code being given to you for the classes being used. These are:
- two_d_point.py
- quadrilateral.py
- rectangle.py
- square.py
Additionally, there are also some test class skeletons also provided (test_two_d_point.py and
test_quadrilateral.py). Your tasks are as follows:
- Complete the codebase for TwoDPoint, Quarilateral, Rectangle, and The incomplete portions of the code are marked with TODO and the methods are provided with documentation explaining what each incomplete method should do.
TwoDPoint (8 points)
Quadrilateral (10 points)
Rectangle (10 points)
Square (8 points)
- Write a class called ShapeSorter (the file name must be 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 class method. (14 points)
- 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 an instance of the (10 points)
- Any method you write in the above tasks must also have corresponding unit tests in the properly named test classes. You are required to follow the naming conventions of the unit test classes and methods as shown by the two test class skeletons (30 points)
The sorting method must have at least 4 unique test cases, one of which must be a boundary value. The snap and membership checking methods must have at least 2 unique test cases (each).
- Any method you write (except for the unit tests) must also have complete type hints for the methods arguments and return For this, do not use any imports from the future module. The given codebase already shows you how to do this. (10 points)
Unimplemented (or mostly unimplemented) methods with just the type hints added to the signature will not be given points for this task.
Attachments:
Expert's Answer
761 Times Downloaded
Related Questions
. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C
DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma
. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an
Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t
. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual
Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th
. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:
1
Project 1
Introduction - the SeaPort Project series
For this set of projects for the course, we wish to simulate some of the aspects of a number of
. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:
1
Project 2
Introduction - the SeaPort Project series
For this set of projects for the course, we wish to simulate some of the aspects of a number of