diff --git a/lesson_06/expression/src/expression_calculator.ts b/lesson_06/expression/src/expression_calculator.ts index 76b215c42..f37f2aaf1 100644 --- a/lesson_06/expression/src/expression_calculator.ts +++ b/lesson_06/expression/src/expression_calculator.ts @@ -2,10 +2,27 @@ 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; + // (a + b) * c / Math.pow(d, e) + const additionVariable = this.add(a, b); + const multiplicationVariable = this.multiply(additionVariable, c); + const powerVariable = this.pow(d, e); + const dividingVariable = this.divide(multiplicationVariable, powerVariable); + return dividingVariable; + } + + add(a: number, b: number): number { + return a + b; + } + + multiply(num1: number, num2: number): number { + return num1 * num2; } pow(base: number, exponent: number): number { return Math.pow(base, exponent); } + + divide(a: number, b: number): number { + return a / b; + } } diff --git a/lesson_06/quiz/src/lesson5.ts b/lesson_06/quiz/src/lesson5.ts index 9ad62bd67..2497d755b 100644 --- a/lesson_06/quiz/src/lesson5.ts +++ b/lesson_06/quiz/src/lesson5.ts @@ -38,7 +38,7 @@ export class Lesson5 { [AnswerChoice.C, "To insert an image"], [AnswerChoice.D, "To create a paragraph"], ]), - AnswerChoice.UNANSWERED, + AnswerChoice.B, ); } @@ -52,7 +52,7 @@ export class Lesson5 { [AnswerChoice.C, "alt"], [AnswerChoice.D, "href"], ]), - AnswerChoice.UNANSWERED, + AnswerChoice.C, ); } @@ -66,7 +66,7 @@ export class Lesson5 { [AnswerChoice.C, "
"], [AnswerChoice.D, ""], ]), - AnswerChoice.UNANSWERED, + AnswerChoice.B, ); } @@ -80,7 +80,7 @@ export class Lesson5 { [AnswerChoice.C, ""], [AnswerChoice.D, "
"], ]), - AnswerChoice.UNANSWERED, + AnswerChoice.D, ); } @@ -94,7 +94,7 @@ export class Lesson5 { [AnswerChoice.C, "Computer Style Sheets"], [AnswerChoice.D, "Cascading System Sheets"], ]), - AnswerChoice.UNANSWERED, + AnswerChoice.B, ); } @@ -108,7 +108,7 @@ export class Lesson5 { [AnswerChoice.C, "text-color"], [AnswerChoice.D, "background-color"], ]), - AnswerChoice.UNANSWERED, + AnswerChoice.B, ); } @@ -122,7 +122,7 @@ export class Lesson5 { [AnswerChoice.C, "/* this is a comment */"], [AnswerChoice.D, ""], ]), - AnswerChoice.UNANSWERED, + AnswerChoice.A, ); } @@ -136,7 +136,7 @@ export class Lesson5 { [AnswerChoice.C, "text-size"], [AnswerChoice.D, "text-style"], ]), - AnswerChoice.UNANSWERED, + AnswerChoice.UB, ); } @@ -150,7 +150,7 @@ export class Lesson5 { [AnswerChoice.C, "inline-block"], [AnswerChoice.D, "none"], ]), - AnswerChoice.UNANSWERED, + AnswerChoice.A, ); } @@ -164,7 +164,7 @@ export class Lesson5 { [AnswerChoice.C, ""], [AnswerChoice.D, ""], ]), - AnswerChoice.UNANSWERED, + AnswerChoice.A, ); } }