$29
Assignment 5.1:
Create a class whose constructor accepts 3 integers which are
the coefficients a, b, and c of the quadratic equation ax^2 + bx + c = 0.
In addition to "dunder" (magic) methods for init, repr, and str,
implement methods to return the discriminant and the 2 roots. Provide error handling for the case where there are no real roots. Instantiate objects of the class that test via assert statements that the correct values are returned in the normal case, the case of 2 identical roots, and the case of no real roots and that the errors are handled appropriately. Provide that this class can
be imported for use in another program. You do not have to provide that other program.
Assignment 5.2:
Define a base class and one derived class wherein they both have magic methods for init and str; they both have at least one attribute and at least one non-magic method; and that the derived class has overrides for at least one attribute and at least one non-magic method. Instantiate an object of each class and test that the objects have correct values for the attributes and return correct values when the methods are called. Use assert statements for those tests. Provide that the class may be used by another program. You do not have to provide that other program.
Upload a zip of your source file(s).