Skip to content

Commit

Permalink
Lesson 06: Completed
Browse files Browse the repository at this point in the history
  • Loading branch information
Cogbonnia committed Oct 9, 2024
1 parent 7cf731a commit 5cc0b85
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions lesson_06/expression/src/expression_calculator.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
export class ExpressionCalculator {
/** Returns the calculation of ((a + b) * c) / d^e */
calculate(a: number, b: number, c: number, d: number, e: number): number {
// Implement your code here to return the correct value.
return 0;
return this.divide(this.multiply(this.add(a, b), c), this.pow(d, e));
}

add(a: number, b: number): number {
return a + b;
}

multiply(value: number, c: number): number {
return value * c;
}

divide(value: number, d: number): number {
return value / d;
}

pow(base: number, exponent: number): number {
Expand Down

0 comments on commit 5cc0b85

Please sign in to comment.