merge completed assignment into main #1
@@ -86,7 +86,7 @@ public class Rational {
|
||||
// COMPLETED - Instance method - this / other
|
||||
public Rational divide(Rational other) {
|
||||
if (other.numerator == 0) {
|
||||
return null;
|
||||
throw new ArithmeticException("Invalid division. Denominator will be zero");
|
||||
}
|
||||
|
||||
int newNumerator = this.numerator * other.denominator;
|
||||
|
||||
Reference in New Issue
Block a user