Question: (programming 2 )C++ Dear all, Below is a question about the structs to practice. Define the struct Rational with the following data members; numerator, denominator

Dear all, Below is a question about the structs to practice. Define the struct Rational with the following data members; numerator, denominator of type integer and fraction of type double. Write a main program that has the following functions: void print(Rational); // to print the rational number. void Fractionform(Rational); // to find the fraction form of the rational numberll! void SimplifyRational(Rational); // to put the rational number in its simplest form!I! bool EqualRationals(Rational, Rational); // to check if tow rational numbers are equal. Do the following in the main program: - Declare the two struct variables rL and rR. - Read values to the numerator and denominator of each variable. - Print the detalls of each variable. - Compare the two variables to check whether they are equal or not. - Implement each of the above functions such that: ofunction print() calls function FractionForm( ). -Function EqualRationals() calls SimplifyRational( ). Use the following code to find the greatest common divisor of two integers: /gcd finds the greatest common divisor for a and b/ int ged ( int a, int b ) {r0=r1;r1=r2;r2=r0%r1; if (r1>0) return r1; else return -r1; Sample input / output: Enter the numerator and denominator of the first number: 2432 Enter the numerator and denominator of the second number: 34 The fraction form of (24/32) is 0.75 The fraction form of (3/4) is 0.75 The two rational numbers are equal
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
