Skip to content

Commit

Permalink
fix: cleanup import and variables in Quadratic
Browse files Browse the repository at this point in the history
  • Loading branch information
jdegand committed Dec 21, 2024
1 parent be6b256 commit a889eda
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Java/QuadraticEquation.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import java.lang.Math;

public class QuadraticEquation {
public static Roots findRoots(double a, double b, double c) {
double root = Math.sqrt(b*b - 4*a*c);
double denominator = 2 * a;
double x1 = (-b + root) / denominator;
double x2 = (-b - root) / denominator;

Roots answer = new Roots(x1,x2);
return answer;
return new Roots(x1,x2);
}

public static void main(String[] args) {
Expand All @@ -18,7 +15,8 @@ public static void main(String[] args) {
}

class Roots {
public final double x1, x2;
public final double x1;
public final double x2;

public Roots(double x1, double x2) {
this.x1 = x1;
Expand Down

0 comments on commit a889eda

Please sign in to comment.