Skip to content

Commit 305f7d8

Browse files
committed
feat: adds correct expressions into expression_calculator.ts
1 parent 615c47c commit 305f7d8

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

lesson_06/expression/.env.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
HW_VERSION=your assigned version here
1+
HW_VERSION=D

lesson_06/expression/src/expression_calculator.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@ export class ExpressionCalculator {
22
/** Returns a calculation involving a, b, c, d, and e */
33
calculate(a: number, b: number, c: number, d: number, e: number): number {
44
// Implement your code here to return the correct value.
5-
return 0;
5+
const sum = c + d;
6+
7+
const denominator = this.pow(sum, e);
8+
9+
const numerator = a * b;
10+
11+
return numerator / denominator;
612
}
713

814
pow(base: number, exponent: number): number {

0 commit comments

Comments
 (0)