i need help writing program in python
Use the fraction.py file located in the I:\kopp\outbox\CS 222 01\Programming Assignments\Chapter 01 folder. Complete the following:
1.Modify the Constructor for the Fraction class so that GCD is used to reduce fractions immediately. This means that the __add__ function no longer needs to reduce.
2.Implement the remaining simple arithmetic operators (__sub__, __mul__, and __truediv__).
3.Implement the remaining relational operators (__gt__, __ge__, __lt__, __le__, and __ne__).
4.Modify the constructor for the Fraction class so that it checks to make sure that the numerator and denominator are both integers.
If either is not an integer the constructor should raise an exception.
You must use the Fraction class created in class and located on the Instructor drive as shown above. If you do not do this, you will receive a grade of 0.
9 years ago 30
Purchase the answer to view it
- fraction1.py
Purchase the answer to view it
- modified-fraction-1.py
- updated-fraction-1.py
- Assignment
- classification
- Patient-Centered Technologies
- Assignment
- Assignment
- ethics written
- NEED ASAP 6 Page paper
- Why does Calhoun oppose the incorporation of Mexico into the United States? What differences does Calhoun see between previous US expansion and the proposed incorporation of Mexico?
- see attachment
- BIO MCQS-WHICH OF THE FOLLOWING IS A COLONIAL FORM OF GREEN ALGAE?