lab8.dvi CS105 Lab 8 Due 12:30 11/14/97 1. Change the representation of class rational so that it contains three elements of data: the numerator and denominator and the closest integer below the number (note that, if i and j are integer variables with positive values, the C++ expression i/j will give you this answer, but if either i or j is negative, you may get something else). You may want to write a private function to set the value of this third datum, but you are not required to do so. 2. Create a private member function that asserts the representation invariant, and use this function to assert that the ob jects created by your constructor functions, and the ob jects created in any member or friend function, obey the rep. inv.. As you add functions in the steps below, continue to add calls to this rep. inv. function as appropriate. 3. Add operators for multiplication, subtraction, and division, and functions \round" (which produces the closest integer to the rational number) and \truncate" (which produces the closest integer that is less than the number - this should be a very short function). 4. Add a constructor that will allow type casting from type int to rational. 5. Add a type casting operation that will allow casting from rational to double. 6. Create a test program that demonstrates all of the operations above, and includes the \if " statement shown below. Also put a comment after the \if " that lists all of your functions that are used during that statement, in the order that they are called. 7. (Extra cre dit) Ensure that rational numbers are always represented in \reduced" form - that is, you will never have a number like 4/2 or 2/6. if (rational(2,3) > 0.5) // is 2/3 > 0.5? cout << ``good'' << endl; else cout << ``uh-oh!'' << endl; // these functions from class rational are used in the above if: // (you fil l in this part)