Question: Question 2 (60 Points) Carefully study the provided BigRational class (Unzip the given le and you will nd a Netbeans project). If you nd any
Question 2 (60 Points) Carefully study the provided BigRational class (Unzip the given le and you will nd a Netbeans project). If you nd any logic errors, x them and list them as comments at the top of the corresponding source le (You may not nd any!). Do the following modications to the BigRational class. Make sure to throw appropriate exceptions. 1. BigRational pow( int exp ) // exception if exp < 0 2. BigRational reciprocal( ) 3. BigInteger toBigInteger( ) // exception if denominator is not 1 4. int toInteger( ) // exception if denominator is not 1 5. Modify the BigRational class so that 0/0 is legal and as interpreted as indeterminate by toString. 2 6. Implement Comparable interface for BigRational class. Store 1 / 3, 1 / 5, 1 / 8, 2 / 8, 3 / 8 as BigRational in an ArrayList. Now use the stock generic algorithm, sort from Collections clsss to sort the content. Print the nal array list and show that it was actually sorted.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
