The class has the following contructors and methods:
* A default constructor that sets the rational numbers to 0/1
* A constructor that has parameters for the numerator and denominator and converts the resulting ratio to simplified form.
* simplify--a private method that converts the rational numbers to simplified form.
* geGCD (x, y )--a private static method that returns the largest common factor of the two positive integers x and y, that is, their greatest common divisor. For example, the greatest common divisor of 40 and 12 is 4.
* getValue--returns the rational number as a double value.
* toString--returns the rational number as a string in the form a/b.
1
Expert's answer
2012-10-17T09:50:54-0400
Unfortunately, your question requires a lot of work and cannot be done for free. Submit it with all requirements as an assignment to our control panel and we'll assist you.
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment