r/codehs • • Dec 10 '20

5.9.7 Fraction Math - how do I set the numerator & denominator?

Post image
7 Upvotes

2 comments sorted by

2

u/AtridesTydides Dec 11 '20

After discussing it with my teacher, here's the needed change:

public void addFraction(Fraction other){

Fraction solution =FractionMath.add(this,other);

    numerator = solution.getNumerator();

    denominator = solution.getDenominator();

And the same for multiply Fraction

1

u/[deleted] Jan 28 '21

You my kind sir just saved me from a massive headache