Question: please use Java to finish this problem and write a test function to test it. thanks!!! Implement a class, named Rational, for reduced-form rational numbers.
please use Java to finish this problem and write a test function to test it. thanks!!!
Implement a class, named Rational, for reduced-form rational numbers. The class has two member variables, named numerator and denominator, and provides member functions for the following arithmetic operations: addition, subtraction, multiplication, and division. A rational number is in the reduced form if the greatest common divisor of the numerator and the denominator is 1.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
