Skip to content

Commit cf0121e

Browse files
author
AmiyahJo
committed
confused and testing
1 parent 7f0a084 commit cf0121e

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

lesson_06/expression/src/expression_calculator.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,24 @@ export class ExpressionCalculator {
22
/** Returns the calculation of ((a + b) * c) / d^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 add = caculateFormula(a ,b);
6+
const expo = d^e;
7+
const multi = add * c;
8+
const divi = multi / expo;
9+
10+
const caculate = divi;
11+
12+
//For this assignment, you will need to implement the functions and logic required to calculate a mathematical expression.
13+
// After implementing the add, divide, and multiply functions, you will combine these functions to compute the final result.
14+
15+
return caculate;
616
}
717

818
pow(base: number, exponent: number): number {
919
return Math.pow(base, exponent);
10-
}
20+
}
1121
}
22+
23+
//npm run compile = update code
24+
//npm start = check your code
25+
//npm run check = check it;

lesson_06/lib/typescript/codedifferently-instructional/package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)