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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!