/* add your method reverse here. */ /* add your method multiply here. */
Consider the class Rational2310 below that represents a rational number using its numerator and denominator.
public class Rational2310 {
private int numerator;
private int denominator;
public Rational2310(int numerator, int denominator){
this.numerator = numerator;
this.denominator = denominator;
}
public int getNumerator() { return numerator; }
public void setNumerator(int numerator) { this.numerator = numerator; }
public int getDenominator() { return denominator; }
public void setDenominator(int denominator) { this.denominator = denominator; }
/* add your method reverse here. */
/* add your method multiply here. */
}
In Rational2310, implement static methods that are called reverse and multiply to
(1) reverses a rational number and return the result as a new rational number and
(2) to multiply two rational numbers and return the result as a new rational number.
main and test methods should not be submitted and not needed
Step by step
Solved in 3 steps with 1 images