Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Account CoCalc 1DI Help this project. It is on an unpaid trial server and has no

ID: 3707808 • Letter: A

Question

Account CoCalc 1DI Help this project. It is on an unpaid trial server and has no network access. Expect very bad performa Log Find Settings p 8-IFSdesignerAndExercises pynt.? Sha Trusted Python 3 (Anac Insert Cell Kernel Help CPU: 0%) Memory 157MB B Sove TimeTravel eclose and halt 3. (1 point) Create a class Rectangle which inhents from Polygon and creates the cectangle triom wes ponts (p g) and (r, s) (Hint the vertices of the rec r), C # min( g. s), and D max(9.8) ) Verity by constructing the rectangle corresponding to (a. b) and (c,d) 1: t 1: 4. (1 point) Defne a class which uses a dictionary in dictionary belo PatternsPesponses 2000 up ??

Explanation / Answer

class Polygon(object): def __init__(self, n): self.number_of_sides = n def print_num_sides(self): print('There are ' + str(self.number_of_sides) + 'sides.') class Rectangle(Polygon): def __init__(self, coordinates): Polygon.__init__(self, 4) self.coordinates = coordinates # list of four numbers: p, q, r, s. def get_rectangle(self): a = np.min(self.coordinates[0], self.coordinates[2]) b = np.max(self.coordinates[0], self.coordinates[2]) c = np.min(self.coordinates[1], self.coordinates[3]) d = np.max(self.coordinates[1], self.coordinates[3]) ac= "(" + str(a)+","+str(c) + ")" ad= "(" + str(a)+","+str(d) + ")" bd= "(" + str(b)+","+str(d) + ")" bc= "(" + str(b)+","+str(c) + ")" return ac, ad, bd, bc

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote