File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -4,26 +4,26 @@ export class ExpressionCalculator {
4
4
// Implement your code here to return the correct value.
5
5
6
6
//PEMDAS order -> expected : //((a + b) * c) / d^e
7
-
8
7
// Caculate addition with an add function '(a + b)'
9
8
const originalSum = you . add ( a , b ) ;
10
9
// caculate multiplication '(add * c)' and 'd^e' so d * (e times)
11
10
const multiply = you . multiply ( originalSum , c )
12
11
// caculate division with divide function which is different variables of the multiplication values '(add * c)' and 'd^e' so d * (e times)
13
12
const lastOne = you . divide ( multiply , d ^ e )
13
+
14
14
return 0 ;
15
15
}
16
16
17
- function add ( a : number , b : number ) {
18
- return a + b ;
17
+ add ( x : number , y : number ) {
18
+ return x + y ;
19
19
}
20
20
21
- function multiply ( originalSum : number , c : number ) {
22
- return originalSum * c ;
21
+ multiply ( x : number , y : number ) {
22
+ return x * y ;
23
23
}
24
24
25
- function divide ( a : number , b : number ) {
26
- return a / b ;
25
+ divide ( x : number , y : number ) {
26
+ return x / y ;
27
27
}
28
28
29
29
pow ( base : number , exponent : number ) : number {
You can’t perform that action at this time.
0 commit comments