I don’t know where i made the mistake :(( I keep getting the same value for the
ID: 3878393 • Letter: I
Question
I don’t know where i made the mistake :(( I keep getting the same value for the first fraction even after I multiplied. It is weire because i get the correct multiplied value but that number doesn’t get replaced to my first fraction value RUN CODE GRADING EXERCISE DOCS HELP MORE ithis exercise, you must take your Fraction class from earlier and extend t by adding a few handy methods YOUR JOB Implement the following methods in the Fraction class public void add(Fraction other) public void subtract(Fraction other) public void multiply(Fraction othen) public int getNumerator() public int getDenominator) public void setNumerator(int x) public void setDenominator(int x) public String tostring() Use the FractionTester file to test as you go along. HINTS Note that public void add(Fraction other) public/ void subtract (Fraction other) publsc/void multiply(Fraction other) are vosd methods. They do not return anything. These methods should not create a new Fraction and return it Instead these methods should modify the instance variables to be added subtracted. or multiplied by the Fraction other 10:06 AMEExplanation / Answer
In the code, you will have to use the set method to set the numerator and denominator to the new respective values after multiplication. You are just printing the result and not using the set numerator and set denominator methods to set the values. This should be done in all the methods.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.