From 1c0ce2ba1171cc673073f72c81b519979a0f2743 Mon Sep 17 00:00:00 2001 From: Partow Roshani Date: Thu, 23 Apr 2026 12:17:56 +0330 Subject: [PATCH] edit --- src/main/java/Rational/Rational.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/Rational/Rational.java b/src/main/java/Rational/Rational.java index 7fa04fa..7bd840e 100644 --- a/src/main/java/Rational/Rational.java +++ b/src/main/java/Rational/Rational.java @@ -39,14 +39,14 @@ public class Rational { } } - // ✅ COMPLETED - Instance method: this + other + // COMPLETED - Instance method: this + other public Rational add(Rational other) { int newNumerator = this.numerator * other.denominator + other.numerator * this.denominator; int newDenominator = this.denominator * other.denominator; return new Rational(newNumerator, newDenominator); } - // ✅ COMPLETED - Static method: r1 + r2 + // COMPLETED - Static method: r1 + r2 public static Rational add(Rational r1, Rational r2) { return r1.add(r2); } @@ -92,7 +92,7 @@ public class Rational { return null; // Remove this line when implemented } - // ✅ PROVIDED - String representation + // PROVIDED - String representation @Override public String toString() { if (denominator == 1) { @@ -101,7 +101,7 @@ public class Rational { return numerator + "/" + denominator; } - // ✅ PROVIDED - Decimal value + // PROVIDED - Decimal value public double toDouble() { return (double) numerator / denominator; }