Skip to content

Feat: jwatson lesson 06 homework #294

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

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion lesson_06/expression/.env.test
Original file line number Diff line number Diff line change
@@ -1 +1 @@
HW_VERSION=your assigned version here
HW_VERSION=E
166 changes: 31 additions & 135 deletions lesson_06/expression/package-lock.json

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

24 changes: 18 additions & 6 deletions lesson_06/expression/src/expression_calculator.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
export class ExpressionCalculator {
/** Returns a calculation involving a, b, c, d, and e */
calculate(a: number, b: number, c: number, d: number, e: number): number {
// Implement your code here to return the correct value.
return 0;
}

pow(base: number, exponent: number): number {
return Math.pow(base, exponent);
}
add(a: number, b: number): number {
return a + b;
}
divide(a: number, b: number): number {
return a / b;
}
multiply(a: number, b: number): number {
return a * b;
}

/** Returns a calculation involving a, b, c, d, and e */
calculate(a: number, b: number, c: number, d: number, e: number): number {
const addition = this.add(a, b);
const division = this.divide(addition, c);
const exponent = this.pow(division, d);
const multiplication = this.multiply(exponent, e);
return multiplication;
}
}