diff --git a/lesson_04/expression/expression_app/src/main/java/com/codedifferently/lesson4/ExpressionCalculator.java b/lesson_04/expression/expression_app/src/main/java/com/codedifferently/lesson4/ExpressionCalculator.java index bd234deb..f69ee18e 100644 --- a/lesson_04/expression/expression_app/src/main/java/com/codedifferently/lesson4/ExpressionCalculator.java +++ b/lesson_04/expression/expression_app/src/main/java/com/codedifferently/lesson4/ExpressionCalculator.java @@ -1,12 +1,25 @@ package com.codedifferently.lesson4; public class ExpressionCalculator { - /** - * Returns the calculation of ((a + b) * c) / d^e - */ + /** Returns the calculation of ((a + b) * c) / d^e */ public double calculate(double a, double b, double c, double d, double e) { - // Implement your code here to return the correct value. - return 0d; + double output = ((a + b) * c) / pow(d, e); + return output; + } + + public double add(double a, double b) { + double sum = a + b; + return sum; + } + + public double multiply(double a, double b) { + double product = a * b; + return product; + } + + public double divide(double a, double b) { + double quotient = a / b; + return quotient; } public double pow(double base, double exponent) {