Skip to content

Commit 1626ef5

Browse files
author
AmiyahJo
committed
function working now
1 parent b155724 commit 1626ef5

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lesson_06/expression/src/expression_calculator.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,26 @@ export class ExpressionCalculator {
44
// Implement your code here to return the correct value.
55

66
//PEMDAS order -> expected : //((a + b) * c) / d^e
7-
87
// Caculate addition with an add function '(a + b)'
98
const originalSum = you.add(a,b);
109
// caculate multiplication '(add * c)' and 'd^e' so d * (e times)
1110
const multiply = you.multiply(originalSum, c)
1211
// caculate division with divide function which is different variables of the multiplication values '(add * c)' and 'd^e' so d * (e times)
1312
const lastOne = you.divide(multiply, d^e)
13+
1414
return 0;
1515
}
1616

17-
function add(a: number , b: number){
18-
return a + b;
17+
add(x: number , y: number){
18+
return x + y;
1919
}
2020

21-
function multiply(originalSum: number , c: number){
22-
return originalSum * c;
21+
multiply(x: number , y: number){
22+
return x * y;
2323
}
2424

25-
function divide(a: number, b: number){
26-
return a / b;
25+
divide(x: number, y: number){
26+
return x / y;
2727
}
2828

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

0 commit comments

Comments
 (0)