Design a program that implements Euclid’s algorithm for findingthe greatest common divisor (also known as greatest common factor,highest common divisor, or highest common factor) of two positiveintegers. The greatest common divisor is the largest integer thatdivides both values without producing a remainder. An iterativeversion of this method was part of the RationalNumber class inChapter 7 of the textbook. Write a RationalNumber class containinga numerator and denominator as its fields. Write a recursive method(named gcd) that computes and returns the greatest common divisorof the numerator and denominator. Write a driver that prompts theuser for a numerator and denominator, creates a RationalNumberobject
OR
OR