diff --git a/src/functions.ts b/src/functions.ts index 674ff85..c96e72c 100644 --- a/src/functions.ts +++ b/src/functions.ts @@ -8,6 +8,7 @@ */ function greet(name: string): void { // Your code here + console.log("Hello "+name); } /** @@ -21,7 +22,9 @@ function greet(name: string): void { */ function isOdd(n: number): boolean { // Your code here - + if(n % 2 !== 0){ + return true + } return false; // replace false with what you see is fit } @@ -36,8 +39,7 @@ function isOdd(n: number): boolean { */ function oddsSmallerThan(n: number): number { // Your code here - - return -1; // replace -1 with what you see is fit + return Math.ceil((n-1)/2); // replace -1 with what you see is fit } /** @@ -52,8 +54,11 @@ function oddsSmallerThan(n: number): number { */ function squareOrDouble(n: number): number { // Your code here + if(n % 2 === 0){ + return n*2; + } - return -1; // replace -1 with what you see is fit + return n*n; // replace -1 with what you see is fit } export { greet, isOdd, oddsSmallerThan, squareOrDouble };