Implement the fraction class add the following functions


Question 1: implement the Fraction Class,

Add the following functions into the definition of the Fraction class above main. The main function already has the calls to those functions written. You must write the required functions into the Fraction class such that main will then compile and execute correctly.

• Part 1: Fraction add( Fraction other) returns a Fraction that is the sum of the two Fractions.
• Part 2: Fraction sub( Fraction other) returns a Fraction that is the difference between this Fraction minus the other Fraction.
• Part 3: Fraction mult( Fraction other) returns a Fraction that is the product of the two Fractions.
• Part 4: Fraction div( Fraction other) returns a Fraction that is the quotient of the two Fractions.
• Part 5: Fraction recip() returns a Fraction that is the reciprocal of this Fractions.
• Part 6: void reduce() Does not return a Fraction. Just modifies this Fraction by reducing it to its lowest form the out put should like

f1=22/7
f2=3/2
65/14
23/14
33/7
44/21
7/22

You must keep every Fraction reduced at all times. This means that when a new Fraction is constructed it must be reduced before that constructor exits.

No Fraction at any time may be stored in a form other than its reduced form.

This makes the outputted value of the Fraction consistent in all cases and thus makes script grading easier.

Give the answer of given question and also give details.

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Implement the fraction class add the following functions
Reference No:- TGS0947818

Expected delivery within 24 Hours