1. Extend the MathOps category from Program 11.1 to also include an invert method, which returns a Fraction that is an inversion of the receiver. 2. Add a category to the Fraction class called...

1. Extend the MathOps category from Program 11.1 to also include an invert method, which returns a Fraction that is an inversion of the receiver.

2. Add a category to the Fraction class called Comparison. In this category, add two methods according to these declarations: -(BOOL) isEqualTo: (Fraction *) f; -(int) compare: (Fraction *) f; The first method should return YES if the two fractions are identical and should return NO otherwise. Be careful about comparing fractions (for example, comparing 3/4 to 6/8 should return YES). The second method should return –1 if the receiver compares less than the fraction represented by the argument, return 0 if the two are equal, and return 1 if the receiver is greater than the argument.




May 26, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here