Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amiyah Jones , Feature/lesson 06 : Expression Caculator #242

Closed
wants to merge 47 commits into from
Closed
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
8cc92d0
Create README.md
AmiyahJo Sep 24, 2024
50b1861
Delete lesson_00/amiyahjones/README.md
AmiyahJo Sep 24, 2024
27d57c0
Merge branch 'code-differently:main' into main
AmiyahJo Sep 25, 2024
fa3c700
Merge branch 'code-differently:main' into main
AmiyahJo Sep 26, 2024
7c2d053
Merge branch 'code-differently:main' into main
AmiyahJo Sep 26, 2024
faedd1b
Merge branch 'code-differently:main' into main
AmiyahJo Sep 26, 2024
19a4187
Merge branch 'code-differently:main' into main
AmiyahJo Sep 26, 2024
7711266
Merge branch 'code-differently:main' into main
AmiyahJo Sep 27, 2024
9a10c4c
Merge branch 'code-differently:main' into main
AmiyahJo Sep 27, 2024
3ea50c4
Merge branch 'code-differently:main' into main
AmiyahJo Sep 27, 2024
d7b772d
Merge branch 'code-differently:main' into main
AmiyahJo Sep 27, 2024
de46b67
Merge branch 'code-differently:main' into main
AmiyahJo Sep 27, 2024
b891561
Merge branch 'code-differently:main' into main
AmiyahJo Sep 28, 2024
7c9f2db
Merge branch 'code-differently:main' into main
AmiyahJo Sep 30, 2024
ff3ba35
Merge branch 'code-differently:main' into main
AmiyahJo Sep 30, 2024
457feea
Merge branch 'code-differently:main' into main
AmiyahJo Sep 30, 2024
5868f9d
Merge branch 'code-differently:main' into main
AmiyahJo Oct 1, 2024
28eacd4
Merge branch 'code-differently:main' into main
AmiyahJo Oct 1, 2024
bca4933
Merge branch 'code-differently:main' into main
AmiyahJo Oct 1, 2024
9ff0f9e
Merge branch 'code-differently:main' into main
AmiyahJo Oct 1, 2024
8d02849
Merge branch 'code-differently:main' into main
AmiyahJo Oct 2, 2024
6dd3a43
Merge branch 'code-differently:main' into main
AmiyahJo Oct 2, 2024
95f56a5
Merge branch 'code-differently:main' into main
AmiyahJo Oct 3, 2024
0f4dbac
Merge branch 'code-differently:main' into main
AmiyahJo Oct 4, 2024
a3b9984
Merge branch 'code-differently:main' into main
AmiyahJo Oct 4, 2024
54cd199
Merge branch 'code-differently:main' into main
AmiyahJo Oct 4, 2024
edbe7c0
Merge branch 'code-differently:main' into main
AmiyahJo Oct 4, 2024
7f0a084
Merge branch 'code-differently:main' into main
AmiyahJo Oct 7, 2024
cf0121e
confused and testing
Oct 7, 2024
056f84a
create seperate functions
Oct 7, 2024
6e4006c
thought proccess in comments
Oct 7, 2024
84730fb
functions add test..?
Oct 7, 2024
b155724
function but they're not working
Oct 7, 2024
1626ef5
function working now
Oct 8, 2024
a12ba3a
variables to calculate
Oct 8, 2024
640a788
went from 'here'.caculate to 'this'
Oct 8, 2024
10ce713
change multiply name
Oct 8, 2024
289f57e
it works!!!
Oct 8, 2024
e75597b
Merge branch 'code-differently:main' into feature/lesson_06
AmiyahJo Oct 8, 2024
2383acb
Merge branch 'code-differently:main' into feature/lesson_06
AmiyahJo Oct 8, 2024
f8ea35f
Merge branch 'code-differently:main' into feature/lesson_06
AmiyahJo Oct 8, 2024
86b38e7
Merge branch 'code-differently:main' into feature/lesson_06
AmiyahJo Oct 9, 2024
de83f81
Merge branch 'code-differently:main' into feature/lesson_06
AmiyahJo Oct 9, 2024
76849b1
Merge branch 'code-differently:main' into feature/lesson_06
AmiyahJo Oct 9, 2024
203f867
Merge branch 'code-differently:main' into feature/lesson_06
AmiyahJo Oct 11, 2024
7857b7b
fix: removed .json file
Oct 11, 2024
7f71e6c
Merge branch 'code-differently:main' into feature/lesson_06
AmiyahJo Oct 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion lesson_06/expression/src/expression_calculator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,35 @@ 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;

// Caculate addition with an add function '(a + b)'
const originalSum = this.add(a, b);
// caculate multiplication '(add * c)'
const MultiplyMySum = this.multiply(originalSum, c);
//Specify the exponent 'd^e'
const myExponent = this.pow(d, e);
// caculate division 'multiply / exponent'
const DivideSum = this.divide(MultiplyMySum, myExponent);
// needs caculate it all...
const calculate = DivideSum;
return calculate;

}

add(x: number, y: number) {
return x + y;
}

multiply(x: number, y: number) {
return x * y;
}

divide(x: number, y: number) {
return x / y;
}

pow(base: number, exponent: number): number {
return Math.pow(base, exponent);
}
}

AmiyahJo marked this conversation as resolved.
Show resolved Hide resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.