Question: please use the python file to answer 1 to 5 and put the number in front of the the answer Solving with Algorithms and Data

 please use the python file to answer 1 to 5 and

please use the python file to answer 1 to 5 and put the number in front of the the answer

Solving with Algorithms and Data Structures Chapters 1.17. Programming Exercises 1. Implement the simple methods getNum and getDen that will return the numerator and denominator of a fraction. In many ways it would be better if all fractions were maintained in lowest terms right from the start. Modify the constructor for the Fraction class so that GCD is used to reduce fractions immediately. Notice that this means the add_ function no longer needs to reduce. Make the necessary modifications. 2. 3. Implement the remaining simple arithmetic operators ( sub, mul andtruediv ). 4. Implement the remaining relational operators (gtge. lt le ,and ne 5. Modify the constructor for the fraction class so that it checks to make sure that the numerator and nominator are both integers. If either is not an integer the constructor should raise an exception

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!